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

breaking | feat: Adds bypass enum to rule suite, removes/replaces User[fragment, matches, object_type, object_url, property] with Users[primary, typeEscaped, value] #69

Merged
merged 1 commit into from
Sep 18, 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,073 changes: 1,957 additions & 2,116 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": "8A4D04861A0268EFD08F02F07BB16E50BA0EB66D63230C614BA24FB782B4A8BCB364698C0A5026295C0079D441BEC640F3A1E9B5873FA5491CD426AEE24221C4",
"descriptionHash": "57655B3059E4927F55E25FC7C6C0CA71284403F23602BEA0AE30B37D1D6316052806C4A004D0B7A6FC26182B22A5E55FA41B424B2C436A8381C1D616C6C64E98",
"descriptionLocation": "../../../../../schemas/ghes-3.13.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.18.0",
Expand Down
6 changes: 3 additions & 3 deletions pkg/github/models/rule_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type RuleSuite struct {
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`.
// 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`. Null if no rules with `evaluate` enforcement status were run.
evaluation_result *RuleSuite_evaluation_result
// The unique identifier of the rule insight.
id *int32
Expand Down Expand Up @@ -71,7 +71,7 @@ func (m *RuleSuite) GetAfterSha()(*string) {
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`.
// 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`. Null if no rules with `evaluate` enforcement status were run.
// returns a *RuleSuite_evaluation_result when successful
func (m *RuleSuite) GetEvaluationResult()(*RuleSuite_evaluation_result) {
return m.evaluation_result
Expand Down Expand Up @@ -353,7 +353,7 @@ func (m *RuleSuite) SetAfterSha(value *string)() {
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`.
// 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`. Null if no rules with `evaluate` enforcement status were run.
func (m *RuleSuite) SetEvaluationResult(value *RuleSuite_evaluation_result)() {
m.evaluation_result = value
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package models
// 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`.
// 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`. Null if no rules with `evaluate` enforcement status were run.
type RuleSuite_evaluation_result int

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
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.
// The detailed failure message for the rule. Null if the rule passed.
details *string
// The enforcement level of this rule source.
enforcement *RuleSuite_rule_evaluations_enforcement
Expand Down Expand Up @@ -35,7 +35,7 @@ func CreateRuleSuite_rule_evaluationsFromDiscriminatorValue(parseNode i878a80d23
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.
// GetDetails gets the details property value. The detailed failure message for the rule. Null if the rule passed.
// returns a *string when successful
func (m *RuleSuite_rule_evaluations) GetDetails()(*string) {
return m.details
Expand Down Expand Up @@ -162,7 +162,7 @@ func (m *RuleSuite_rule_evaluations) Serialize(writer i878a80d2330e89d26896388a3
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.
// SetDetails sets the details property value. The detailed failure message for the rule. Null if the rule passed.
func (m *RuleSuite_rule_evaluations) SetDetails(value *string)() {
m.details = value
}
Expand Down
152 changes: 41 additions & 111 deletions pkg/github/models/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ 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
// 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
// Whether this email address is the primary address.
primary *bool
// The type of email address.
typeEscaped *string
// The email address.
value *string
}
// NewUsers instantiates a new Users and sets the default values.
func NewUsers()(*Users) {
Expand All @@ -39,123 +35,69 @@ 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["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()
res["primary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetObjectType(val)
m.SetPrimary(val)
}
return nil
}
res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetObjectUrl(val)
m.SetTypeEscaped(val)
}
return nil
}
res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetProperty(val)
m.SetValue(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
// 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
}
// GetObjectUrl gets the object_url property value. The object_url property
// GetTypeEscaped gets the type property value. The type of email address.
// returns a *string when successful
func (m *Users) GetObjectUrl()(*string) {
return m.object_url
func (m *Users) GetTypeEscaped()(*string) {
return m.typeEscaped
}
// GetProperty gets the property property value. The property property
// GetValue gets the value property value. The email address.
// returns a *string when successful
func (m *Users) GetProperty()(*string) {
return m.property
func (m *Users) GetValue()(*string) {
return m.value
}
// 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())
err := writer.WriteBoolValue("primary", m.GetPrimary())
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("object_url", m.GetObjectUrl())
err := writer.WriteStringValue("type", m.GetTypeEscaped())
if err != nil {
return err
}
}
{
err := writer.WriteStringValue("property", m.GetProperty())
err := writer.WriteStringValue("value", m.GetValue())
if err != nil {
return err
}
Expand All @@ -172,37 +114,25 @@ func (m *Users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c4
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
// SetPrimary sets the primary property value. Whether this email address is the primary address.
func (m *Users) SetPrimary(value *bool)() {
m.primary = value
}
// SetObjectUrl sets the object_url property value. The object_url property
func (m *Users) SetObjectUrl(value *string)() {
m.object_url = value
// SetTypeEscaped sets the type property value. The type of email address.
func (m *Users) SetTypeEscaped(value *string)() {
m.typeEscaped = value
}
// SetProperty sets the property property value. The property property
func (m *Users) SetProperty(value *string)() {
m.property = value
// SetValue sets the value property value. The email address.
func (m *Users) SetValue(value *string)() {
m.value = 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)()
GetPrimary()(*bool)
GetTypeEscaped()(*string)
GetValue()(*string)
SetPrimary(value *bool)()
SetTypeEscaped(value *string)()
SetValue(value *string)()
}
Loading
Loading