Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: Updates users #87

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,485 changes: 2,169 additions & 2,316 deletions pkg/github/.kiota.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/github/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "74F535465F8C80AD4EAC12ED7F48EA48BE8FB9A3A04AF726140643312436081CA74E05C7BA5354C118E75C5D6FA4FA0A2DFE539C8B18DB026459DF3A909A7FCA",
"descriptionHash": "42342DB5DA0A2E38D39851FF9B2762416C72313AD8D9F96413AC131558CC65D9D73E2F462F39A044D278D93D0EA99C3AC5344EE58C4EA17062CC84EF94D57E91",
"descriptionLocation": "../../../../../schemas/ghes-3.13.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.18.0",
Expand Down
2 changes: 1 addition & 1 deletion pkg/github/models/org_ruleset_conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.
// OrgRulesetConditions conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.
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
Expand Down
8 changes: 5 additions & 3 deletions pkg/github/models/repository_ruleset_bypass_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ type RepositoryRulesetBypassActor struct {
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.
// 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. Also, `pull_request` is only applicable to branch rulesets.
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))
bypass_modeValue := ALWAYS_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE
m.SetBypassMode(&bypass_modeValue)
return m
}
// CreateRepositoryRulesetBypassActorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
Expand All @@ -42,7 +44,7 @@ func (m *RepositoryRulesetBypassActor) GetActorType()(*RepositoryRulesetBypassAc
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.
// 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. Also, `pull_request` is only applicable to branch rulesets.
// returns a *RepositoryRulesetBypassActor_bypass_mode when successful
func (m *RepositoryRulesetBypassActor) GetBypassMode()(*RepositoryRulesetBypassActor_bypass_mode) {
return m.bypass_mode
Expand Down Expand Up @@ -125,7 +127,7 @@ func (m *RepositoryRulesetBypassActor) SetActorType(value *RepositoryRulesetBypa
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.
// 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. Also, `pull_request` is only applicable to branch rulesets.
func (m *RepositoryRulesetBypassActor) SetBypassMode(value *RepositoryRulesetBypassActor_bypass_mode)() {
m.bypass_mode = value
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package models
// 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.
// 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. Also, `pull_request` is only applicable to branch rulesets.
type RepositoryRulesetBypassActor_bypass_mode int

const (
Expand Down
152 changes: 111 additions & 41 deletions pkg/github/models/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ import (
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
// Whether this email address is the primary address.
primary *bool
// The type of email address.
typeEscaped *string
// The email address.
value *string
// 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) {
Expand All @@ -35,69 +39,123 @@ func (m *Users) GetAdditionalData()(map[string]any) {
// 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["primary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
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.SetPrimary(val)
m.SetObjectType(val)
}
return nil
}
res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetTypeEscaped(val)
m.SetObjectUrl(val)
}
return nil
}
res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetValue(val)
m.SetProperty(val)
}
return nil
}
return res
}
// GetPrimary gets the primary property value. Whether this email address is the primary address.
// returns a *bool when successful
func (m *Users) GetPrimary()(*bool) {
return m.primary
// 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
}
// GetTypeEscaped gets the type property value. The type of email address.
// GetObjectUrl gets the object_url property value. The object_url property
// returns a *string when successful
func (m *Users) GetTypeEscaped()(*string) {
return m.typeEscaped
func (m *Users) GetObjectUrl()(*string) {
return m.object_url
}
// GetValue gets the value property value. The email address.
// GetProperty gets the property property value. The property property
// returns a *string when successful
func (m *Users) GetValue()(*string) {
return m.value
func (m *Users) GetProperty()(*string) {
return m.property
}
// Serialize serializes information the current object
func (m *Users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
{
err := writer.WriteBoolValue("primary", m.GetPrimary())
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("type", m.GetTypeEscaped())
err := writer.WriteStringValue("object_url", m.GetObjectUrl())
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("value", m.GetValue())
err := writer.WriteStringValue("property", m.GetProperty())
if err != nil {
return err
}
Expand All @@ -114,25 +172,37 @@ func (m *Users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c4
func (m *Users) SetAdditionalData(value map[string]any)() {
m.additionalData = value
}
// SetPrimary sets the primary property value. Whether this email address is the primary address.
func (m *Users) SetPrimary(value *bool)() {
m.primary = 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
}
// SetTypeEscaped sets the type property value. The type of email address.
func (m *Users) SetTypeEscaped(value *string)() {
m.typeEscaped = value
// SetObjectUrl sets the object_url property value. The object_url property
func (m *Users) SetObjectUrl(value *string)() {
m.object_url = value
}
// SetValue sets the value property value. The email address.
func (m *Users) SetValue(value *string)() {
m.value = 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
GetPrimary()(*bool)
GetTypeEscaped()(*string)
GetValue()(*string)
SetPrimary(value *bool)()
SetTypeEscaped(value *string)()
SetValue(value *string)()
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)()
}
115 changes: 115 additions & 0 deletions pkg/github/models/users_escaped_matches.go
Original file line number Diff line number Diff line change
@@ -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)()
}
Loading
Loading