-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82d67e3
commit d75347c
Showing
35 changed files
with
4,611 additions
and
2,737 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
...ub/enterprises/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package item | ||
// The target of the ruleset | ||
type WithRuleset_PutRequestBody_target int | ||
|
||
const ( | ||
BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET WithRuleset_PutRequestBody_target = iota | ||
TAG_WITHRULESET_PUTREQUESTBODY_TARGET | ||
PUSH_WITHRULESET_PUTREQUESTBODY_TARGET | ||
REPOSITORY_WITHRULESET_PUTREQUESTBODY_TARGET | ||
) | ||
|
||
func (i WithRuleset_PutRequestBody_target) String() string { | ||
return []string{"branch", "tag", "push", "repository"}[i] | ||
} | ||
func ParseWithRuleset_PutRequestBody_target(v string) (any, error) { | ||
result := BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET | ||
switch v { | ||
case "branch": | ||
result = BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET | ||
case "tag": | ||
result = TAG_WITHRULESET_PUTREQUESTBODY_TARGET | ||
case "push": | ||
result = PUSH_WITHRULESET_PUTREQUESTBODY_TARGET | ||
case "repository": | ||
result = REPOSITORY_WITHRULESET_PUTREQUESTBODY_TARGET | ||
default: | ||
return nil, nil | ||
} | ||
return &result, nil | ||
} | ||
func SerializeWithRuleset_PutRequestBody_target(values []WithRuleset_PutRequestBody_target) []string { | ||
result := make([]string, len(values)) | ||
for i, v := range values { | ||
result[i] = v.String() | ||
} | ||
return result | ||
} | ||
func (i WithRuleset_PutRequestBody_target) isMultiValue() bool { | ||
return false | ||
} |
40 changes: 40 additions & 0 deletions
40
pkg/github/enterprises/item/rulesets/rulesets_post_request_body_escaped_target.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package rulesets | ||
// The target of the ruleset | ||
type RulesetsPostRequestBody_target int | ||
|
||
const ( | ||
BRANCH_RULESETSPOSTREQUESTBODY_TARGET RulesetsPostRequestBody_target = iota | ||
TAG_RULESETSPOSTREQUESTBODY_TARGET | ||
PUSH_RULESETSPOSTREQUESTBODY_TARGET | ||
REPOSITORY_RULESETSPOSTREQUESTBODY_TARGET | ||
) | ||
|
||
func (i RulesetsPostRequestBody_target) String() string { | ||
return []string{"branch", "tag", "push", "repository"}[i] | ||
} | ||
func ParseRulesetsPostRequestBody_target(v string) (any, error) { | ||
result := BRANCH_RULESETSPOSTREQUESTBODY_TARGET | ||
switch v { | ||
case "branch": | ||
result = BRANCH_RULESETSPOSTREQUESTBODY_TARGET | ||
case "tag": | ||
result = TAG_RULESETSPOSTREQUESTBODY_TARGET | ||
case "push": | ||
result = PUSH_RULESETSPOSTREQUESTBODY_TARGET | ||
case "repository": | ||
result = REPOSITORY_RULESETSPOSTREQUESTBODY_TARGET | ||
default: | ||
return nil, nil | ||
} | ||
return &result, nil | ||
} | ||
func SerializeRulesetsPostRequestBody_target(values []RulesetsPostRequestBody_target) []string { | ||
result := make([]string, len(values)) | ||
for i, v := range values { | ||
result[i] = v.String() | ||
} | ||
return result | ||
} | ||
func (i RulesetsPostRequestBody_target) isMultiValue() bool { | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
222 changes: 222 additions & 0 deletions
222
pkg/github/enterprises/item_rulesets_item_with_ruleset_escaped_put_request_body.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
package enterprises | ||
|
||
import ( | ||
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" | ||
i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d "github.com/octokit/go-sdk-enterprise-cloud/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 []i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRulesetBypassActorable | ||
// Conditions for an enterprise ruleset. The conditions object should contain either the `organization_id` or `organization_name` property and the `repository_name` or `repository_property` property. For branch and tag rulesets, the conditions object should also contain the `ref_name` property. | ||
conditions i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.EnterpriseRulesetConditionsable | ||
// 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 not available for the `repository` target. | ||
enforcement *i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRuleEnforcement | ||
// The name of the ruleset. | ||
name *string | ||
// An array of rules within the ruleset. | ||
rules []i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.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()([]i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRulesetBypassActorable) { | ||
return m.bypass_actors | ||
} | ||
// GetConditions gets the conditions property value. Conditions for an enterprise ruleset. The conditions object should contain either the `organization_id` or `organization_name` property and the `repository_name` or `repository_property` property. For branch and tag rulesets, the conditions object should also contain the `ref_name` property. | ||
// returns a EnterpriseRulesetConditionsable when successful | ||
func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetConditions()(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.EnterpriseRulesetConditionsable) { | ||
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 not available for the `repository` target. | ||
// returns a *RepositoryRuleEnforcement when successful | ||
func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetEnforcement()(*i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.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(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.CreateRepositoryRulesetBypassActorFromDiscriminatorValue) | ||
if err != nil { | ||
return err | ||
} | ||
if val != nil { | ||
res := make([]i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRulesetBypassActorable, len(val)) | ||
for i, v := range val { | ||
if v != nil { | ||
res[i] = v.(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRulesetBypassActorable) | ||
} | ||
} | ||
m.SetBypassActors(res) | ||
} | ||
return nil | ||
} | ||
res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { | ||
val, err := n.GetObjectValue(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.CreateEnterpriseRulesetConditionsFromDiscriminatorValue) | ||
if err != nil { | ||
return err | ||
} | ||
if val != nil { | ||
m.SetConditions(val.(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.EnterpriseRulesetConditionsable)) | ||
} | ||
return nil | ||
} | ||
res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { | ||
val, err := n.GetEnumValue(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.ParseRepositoryRuleEnforcement) | ||
if err != nil { | ||
return err | ||
} | ||
if val != nil { | ||
m.SetEnforcement(val.(*i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.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(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.CreateRepositoryRuleFromDiscriminatorValue) | ||
if err != nil { | ||
return err | ||
} | ||
if val != nil { | ||
res := make([]i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRuleable, len(val)) | ||
for i, v := range val { | ||
if v != nil { | ||
res[i] = v.(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.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()([]i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.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 []i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRulesetBypassActorable)() { | ||
m.bypass_actors = value | ||
} | ||
// SetConditions sets the conditions property value. Conditions for an enterprise ruleset. The conditions object should contain either the `organization_id` or `organization_name` property and the `repository_name` or `repository_property` property. For branch and tag rulesets, the conditions object should also contain the `ref_name` property. | ||
func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetConditions(value i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.EnterpriseRulesetConditionsable)() { | ||
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 not available for the `repository` target. | ||
func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetEnforcement(value *i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.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 []i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRuleable)() { | ||
m.rules = value | ||
} | ||
type ItemRulesetsItemWithRuleset_PutRequestBodyable interface { | ||
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder | ||
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable | ||
GetBypassActors()([]i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRulesetBypassActorable) | ||
GetConditions()(i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.EnterpriseRulesetConditionsable) | ||
GetEnforcement()(*i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRuleEnforcement) | ||
GetName()(*string) | ||
GetRules()([]i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRuleable) | ||
SetBypassActors(value []i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRulesetBypassActorable)() | ||
SetConditions(value i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.EnterpriseRulesetConditionsable)() | ||
SetEnforcement(value *i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRuleEnforcement)() | ||
SetName(value *string)() | ||
SetRules(value []i65c45deea5ef786561f9cd3a81f83eacee03df1f39b7b57e269c7f0477b77b5d.RepositoryRuleable)() | ||
} |
Oops, something went wrong.