From 7484b0c6d796b6237e3eb32a3aa4848dedb1897b Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Wed, 14 Aug 2024 00:08:53 +0000 Subject: [PATCH] New updates to generated code --- pkg/github/kiota-lock.json | 2 +- .../models/code_security_configuration.go | 59 +++++++ ...tion_dependency_graph_autosubmit_action.go | 40 +++++ ...endency_graph_autosubmit_action_options.go | 81 ++++++++++ ..._custom_property.go => custom_property.go} | 147 +++++++++++------- .../models/custom_property_value_type.go | 43 +++++ .../custom_property_values_editable_by.go | 37 +++++ .../models/org_custom_property_value_type.go | 43 ----- .../org_custom_property_values_editable_by.go | 37 ----- .../secret_scanning_push_protection_bypass.go | 140 +++++++++++++++++ ...canning_push_protection_bypass503_error.go | 146 +++++++++++++++++ ..._scanning_push_protection_bypass_reason.go | 40 +++++ ...body_dependency_graph_autosubmit_action.go | 40 +++++ ...body_dependency_graph_autosubmit_action.go | 40 +++++ ...m_with_configuration_patch_request_body.go | 29 ++++ ...endency_graph_autosubmit_action_options.go | 81 ++++++++++ ...curity_configurations_post_request_body.go | 29 ++++ ...endency_graph_autosubmit_action_options.go | 81 ++++++++++ ...em_properties_schema_patch_request_body.go | 18 +-- .../item_properties_schema_request_builder.go | 20 +-- ...stom_property_name_item_request_builder.go | 16 +- .../item_team_item_copilot_request_builder.go | 28 ++++ ...team_item_copilot_usage_request_builder.go | 81 ++++++++++ pkg/github/orgs/item_team_request_builder.go | 35 +++++ ...eam_with_team_slug_item_request_builder.go | 28 ++++ .../orgs/with_org_item_request_builder.go | 5 + ...h_protection_bypasses_post_request_body.go | 111 +++++++++++++ ...ush_protection_bypasses_request_builder.go | 65 ++++++++ ...em_item_secret_scanning_request_builder.go | 5 + 29 files changed, 1360 insertions(+), 167 deletions(-) create mode 100644 pkg/github/models/code_security_configuration_dependency_graph_autosubmit_action.go create mode 100644 pkg/github/models/code_security_configuration_dependency_graph_autosubmit_action_options.go rename pkg/github/models/{org_custom_property.go => custom_property.go} (61%) create mode 100644 pkg/github/models/custom_property_value_type.go create mode 100644 pkg/github/models/custom_property_values_editable_by.go delete mode 100644 pkg/github/models/org_custom_property_value_type.go delete mode 100644 pkg/github/models/org_custom_property_values_editable_by.go create mode 100644 pkg/github/models/secret_scanning_push_protection_bypass.go create mode 100644 pkg/github/models/secret_scanning_push_protection_bypass503_error.go create mode 100644 pkg/github/models/secret_scanning_push_protection_bypass_reason.go create mode 100644 pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependency_graph_autosubmit_action.go create mode 100644 pkg/github/orgs/item/codesecurity/configurations/item/with_configuration_patch_request_body_dependency_graph_autosubmit_action.go create mode 100644 pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body_dependency_graph_autosubmit_action_options.go create mode 100644 pkg/github/orgs/item_code_security_configurations_post_request_body_dependency_graph_autosubmit_action_options.go create mode 100644 pkg/github/orgs/item_team_item_copilot_request_builder.go create mode 100644 pkg/github/orgs/item_team_item_copilot_usage_request_builder.go create mode 100644 pkg/github/orgs/item_team_request_builder.go create mode 100644 pkg/github/orgs/item_team_with_team_slug_item_request_builder.go create mode 100644 pkg/github/repos/item_item_secret_scanning_push_protection_bypasses_post_request_body.go create mode 100644 pkg/github/repos/item_item_secret_scanning_push_protection_bypasses_request_builder.go diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index 2454be91..ad7dc347 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "42630C0DDFA67D3B09011BD79A8AF6A0ADF8ADDCACE743727781B6FA96E24C606120BF6FF5B99C436A8D4CBC381990F1A61E28302AB71CE24E79650C976C013F", + "descriptionHash": "694359525568DD1AA45AFD91B5B9D5AD295A934D8D3DDFF2239A7D9E045B1D4FB9160ADA93E86FEAA6B699200247F0089475A684F1EF62141A39A9B717822BD6", "descriptionLocation": "../../../../../schemas/api.github.com.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.14.0", diff --git a/pkg/github/models/code_security_configuration.go b/pkg/github/models/code_security_configuration.go index 9392aee8..8eb5f8d9 100644 --- a/pkg/github/models/code_security_configuration.go +++ b/pkg/github/models/code_security_configuration.go @@ -21,6 +21,10 @@ type CodeSecurityConfiguration struct { dependabot_security_updates *CodeSecurityConfiguration_dependabot_security_updates // The enablement status of Dependency Graph dependency_graph *CodeSecurityConfiguration_dependency_graph + // The enablement status of Automatic dependency submission + dependency_graph_autosubmit_action *CodeSecurityConfiguration_dependency_graph_autosubmit_action + // Feature options for Automatic dependency submission + dependency_graph_autosubmit_action_options CodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsable // A description of the code security configuration description *string // The enforcement status for a security configuration @@ -93,6 +97,16 @@ func (m *CodeSecurityConfiguration) GetDependabotSecurityUpdates()(*CodeSecurity func (m *CodeSecurityConfiguration) GetDependencyGraph()(*CodeSecurityConfiguration_dependency_graph) { return m.dependency_graph } +// GetDependencyGraphAutosubmitAction gets the dependency_graph_autosubmit_action property value. The enablement status of Automatic dependency submission +// returns a *CodeSecurityConfiguration_dependency_graph_autosubmit_action when successful +func (m *CodeSecurityConfiguration) GetDependencyGraphAutosubmitAction()(*CodeSecurityConfiguration_dependency_graph_autosubmit_action) { + return m.dependency_graph_autosubmit_action +} +// GetDependencyGraphAutosubmitActionOptions gets the dependency_graph_autosubmit_action_options property value. Feature options for Automatic dependency submission +// returns a CodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsable when successful +func (m *CodeSecurityConfiguration) GetDependencyGraphAutosubmitActionOptions()(CodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsable) { + return m.dependency_graph_autosubmit_action_options +} // GetDescription gets the description property value. A description of the code security configuration // returns a *string when successful func (m *CodeSecurityConfiguration) GetDescription()(*string) { @@ -167,6 +181,26 @@ func (m *CodeSecurityConfiguration) GetFieldDeserializers()(map[string]func(i878 } return nil } + res["dependency_graph_autosubmit_action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeSecurityConfiguration_dependency_graph_autosubmit_action) + if err != nil { + return err + } + if val != nil { + m.SetDependencyGraphAutosubmitAction(val.(*CodeSecurityConfiguration_dependency_graph_autosubmit_action)) + } + return nil + } + res["dependency_graph_autosubmit_action_options"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependencyGraphAutosubmitActionOptions(val.(CodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsable)) + } + return nil + } res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { @@ -382,6 +416,19 @@ func (m *CodeSecurityConfiguration) Serialize(writer i878a80d2330e89d26896388a3f return err } } + if m.GetDependencyGraphAutosubmitAction() != nil { + cast := (*m.GetDependencyGraphAutosubmitAction()).String() + err := writer.WriteStringValue("dependency_graph_autosubmit_action", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dependency_graph_autosubmit_action_options", m.GetDependencyGraphAutosubmitActionOptions()) + if err != nil { + return err + } + } { err := writer.WriteStringValue("description", m.GetDescription()) if err != nil { @@ -496,6 +543,14 @@ func (m *CodeSecurityConfiguration) SetDependabotSecurityUpdates(value *CodeSecu func (m *CodeSecurityConfiguration) SetDependencyGraph(value *CodeSecurityConfiguration_dependency_graph)() { m.dependency_graph = value } +// SetDependencyGraphAutosubmitAction sets the dependency_graph_autosubmit_action property value. The enablement status of Automatic dependency submission +func (m *CodeSecurityConfiguration) SetDependencyGraphAutosubmitAction(value *CodeSecurityConfiguration_dependency_graph_autosubmit_action)() { + m.dependency_graph_autosubmit_action = value +} +// SetDependencyGraphAutosubmitActionOptions sets the dependency_graph_autosubmit_action_options property value. Feature options for Automatic dependency submission +func (m *CodeSecurityConfiguration) SetDependencyGraphAutosubmitActionOptions(value CodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsable)() { + m.dependency_graph_autosubmit_action_options = value +} // SetDescription sets the description property value. A description of the code security configuration func (m *CodeSecurityConfiguration) SetDescription(value *string)() { m.description = value @@ -553,6 +608,8 @@ type CodeSecurityConfigurationable interface { GetDependabotAlerts()(*CodeSecurityConfiguration_dependabot_alerts) GetDependabotSecurityUpdates()(*CodeSecurityConfiguration_dependabot_security_updates) GetDependencyGraph()(*CodeSecurityConfiguration_dependency_graph) + GetDependencyGraphAutosubmitAction()(*CodeSecurityConfiguration_dependency_graph_autosubmit_action) + GetDependencyGraphAutosubmitActionOptions()(CodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsable) GetDescription()(*string) GetEnforcement()(*CodeSecurityConfiguration_enforcement) GetHtmlUrl()(*string) @@ -571,6 +628,8 @@ type CodeSecurityConfigurationable interface { SetDependabotAlerts(value *CodeSecurityConfiguration_dependabot_alerts)() SetDependabotSecurityUpdates(value *CodeSecurityConfiguration_dependabot_security_updates)() SetDependencyGraph(value *CodeSecurityConfiguration_dependency_graph)() + SetDependencyGraphAutosubmitAction(value *CodeSecurityConfiguration_dependency_graph_autosubmit_action)() + SetDependencyGraphAutosubmitActionOptions(value CodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsable)() SetDescription(value *string)() SetEnforcement(value *CodeSecurityConfiguration_enforcement)() SetHtmlUrl(value *string)() diff --git a/pkg/github/models/code_security_configuration_dependency_graph_autosubmit_action.go b/pkg/github/models/code_security_configuration_dependency_graph_autosubmit_action.go new file mode 100644 index 00000000..502d9e51 --- /dev/null +++ b/pkg/github/models/code_security_configuration_dependency_graph_autosubmit_action.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The enablement status of Automatic dependency submission +type CodeSecurityConfiguration_dependency_graph_autosubmit_action int + +const ( + ENABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION CodeSecurityConfiguration_dependency_graph_autosubmit_action = iota + DISABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + NOT_SET_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION +) + +func (i CodeSecurityConfiguration_dependency_graph_autosubmit_action) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseCodeSecurityConfiguration_dependency_graph_autosubmit_action(v string) (any, error) { + result := ENABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + switch v { + case "enabled": + result = ENABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + case "disabled": + result = DISABLED_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + case "not_set": + result = NOT_SET_CODESECURITYCONFIGURATION_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + default: + return 0, errors.New("Unknown CodeSecurityConfiguration_dependency_graph_autosubmit_action value: " + v) + } + return &result, nil +} +func SerializeCodeSecurityConfiguration_dependency_graph_autosubmit_action(values []CodeSecurityConfiguration_dependency_graph_autosubmit_action) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeSecurityConfiguration_dependency_graph_autosubmit_action) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_security_configuration_dependency_graph_autosubmit_action_options.go b/pkg/github/models/code_security_configuration_dependency_graph_autosubmit_action_options.go new file mode 100644 index 00000000..c0a7cf8e --- /dev/null +++ b/pkg/github/models/code_security_configuration_dependency_graph_autosubmit_action_options.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeSecurityConfiguration_dependency_graph_autosubmit_action_options feature options for Automatic dependency submission +type CodeSecurityConfiguration_dependency_graph_autosubmit_action_options 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 use runners labeled with 'dependency-submission' or standard GitHub runners. + labeled_runners *bool +} +// NewCodeSecurityConfiguration_dependency_graph_autosubmit_action_options instantiates a new CodeSecurityConfiguration_dependency_graph_autosubmit_action_options and sets the default values. +func NewCodeSecurityConfiguration_dependency_graph_autosubmit_action_options()(*CodeSecurityConfiguration_dependency_graph_autosubmit_action_options) { + m := &CodeSecurityConfiguration_dependency_graph_autosubmit_action_options{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeSecurityConfiguration_dependency_graph_autosubmit_action_options(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not 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_dependency_graph_autosubmit_action_options) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeSecurityConfiguration_dependency_graph_autosubmit_action_options) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labeled_runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLabeledRunners(val) + } + return nil + } + return res +} +// GetLabeledRunners gets the labeled_runners property value. Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. +// returns a *bool when successful +func (m *CodeSecurityConfiguration_dependency_graph_autosubmit_action_options) GetLabeledRunners()(*bool) { + return m.labeled_runners +} +// Serialize serializes information the current object +func (m *CodeSecurityConfiguration_dependency_graph_autosubmit_action_options) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("labeled_runners", m.GetLabeledRunners()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the 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_dependency_graph_autosubmit_action_options) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabeledRunners sets the labeled_runners property value. Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. +func (m *CodeSecurityConfiguration_dependency_graph_autosubmit_action_options) SetLabeledRunners(value *bool)() { + m.labeled_runners = value +} +type CodeSecurityConfiguration_dependency_graph_autosubmit_action_optionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabeledRunners()(*bool) + SetLabeledRunners(value *bool)() +} diff --git a/pkg/github/models/org_custom_property.go b/pkg/github/models/custom_property.go similarity index 61% rename from pkg/github/models/org_custom_property.go rename to pkg/github/models/custom_property.go index 24d49e4b..b41f3d9e 100644 --- a/pkg/github/models/org_custom_property.go +++ b/pkg/github/models/custom_property.go @@ -4,40 +4,42 @@ import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) -// OrgCustomProperty custom property defined on an organization -type OrgCustomProperty struct { +// CustomProperty custom property defined on an organization +type CustomProperty 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 + default_value CustomProperty_CustomProperty_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 URL that can be used to fetch, update, or delete info about this property via the API. + url *string // The type of the value for the property - value_type *OrgCustomProperty_value_type + value_type *CustomProperty_value_type // Who can edit the values of the property - values_editable_by *OrgCustomProperty_values_editable_by + values_editable_by *CustomProperty_values_editable_by } -// OrgCustomProperty_OrgCustomProperty_default_value composed type wrapper for classes string -type OrgCustomProperty_OrgCustomProperty_default_value struct { +// CustomProperty_CustomProperty_default_value composed type wrapper for classes string +type CustomProperty_CustomProperty_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{ +// NewCustomProperty_CustomProperty_default_value instantiates a new CustomProperty_CustomProperty_default_value and sets the default values. +func NewCustomProperty_CustomProperty_default_value()(*CustomProperty_CustomProperty_default_value) { + m := &CustomProperty_CustomProperty_default_value{ } return m } -// CreateOrgCustomProperty_OrgCustomProperty_default_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// CreateCustomProperty_CustomProperty_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() +func CreateCustomProperty_CustomProperty_default_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCustomProperty_CustomProperty_default_value() if parseNode != nil { mappingValueNode, err := parseNode.GetChildNode("") if err != nil { @@ -62,21 +64,21 @@ func CreateOrgCustomProperty_OrgCustomProperty_default_valueFromDiscriminatorVal } // 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)) { +func (m *CustomProperty_CustomProperty_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) { +func (m *CustomProperty_CustomProperty_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) { +func (m *CustomProperty_CustomProperty_default_value) GetString()(*string) { return m.string } // Serialize serializes information the current object -func (m *OrgCustomProperty_OrgCustomProperty_default_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { +func (m *CustomProperty_CustomProperty_default_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { if m.GetString() != nil { err := writer.WriteStringValue("", m.GetString()) if err != nil { @@ -86,49 +88,49 @@ func (m *OrgCustomProperty_OrgCustomProperty_default_value) Serialize(writer i87 return nil } // SetString sets the string property value. Composed type representation for type string -func (m *OrgCustomProperty_OrgCustomProperty_default_value) SetString(value *string)() { +func (m *CustomProperty_CustomProperty_default_value) SetString(value *string)() { m.string = value } -type OrgCustomProperty_OrgCustomProperty_default_valueable interface { +type CustomProperty_CustomProperty_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{ +// NewCustomProperty instantiates a new CustomProperty and sets the default values. +func NewCustomProperty()(*CustomProperty) { + m := &CustomProperty{ } m.SetAdditionalData(make(map[string]any)) return m } -// CreateOrgCustomPropertyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// CreateCustomPropertyFromDiscriminatorValue 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 +func CreateCustomPropertyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCustomProperty(), nil } // GetAdditionalData gets the AdditionalData property value. Stores additional data not 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) { +func (m *CustomProperty) 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) { +func (m *CustomProperty) 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) { +// returns a CustomProperty_CustomProperty_default_valueable when successful +func (m *CustomProperty) GetDefaultValue()(CustomProperty_CustomProperty_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) { +func (m *CustomProperty) 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)) { +func (m *CustomProperty) 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") @@ -147,12 +149,12 @@ func (m *OrgCustomProperty) GetFieldDeserializers()(map[string]func(i878a80d2330 return nil } res["default_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetObjectValue(CreateOrgCustomProperty_OrgCustomProperty_default_valueFromDiscriminatorValue) + val, err := n.GetObjectValue(CreateCustomProperty_CustomProperty_default_valueFromDiscriminatorValue) if err != nil { return err } if val != nil { - m.SetDefaultValue(val.(OrgCustomProperty_OrgCustomProperty_default_valueable)) + m.SetDefaultValue(val.(CustomProperty_CustomProperty_default_valueable)) } return nil } @@ -186,23 +188,33 @@ func (m *OrgCustomProperty) GetFieldDeserializers()(map[string]func(i878a80d2330 } 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["value_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetEnumValue(ParseOrgCustomProperty_value_type) + val, err := n.GetEnumValue(ParseCustomProperty_value_type) if err != nil { return err } if val != nil { - m.SetValueType(val.(*OrgCustomProperty_value_type)) + m.SetValueType(val.(*CustomProperty_value_type)) } return nil } res["values_editable_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetEnumValue(ParseOrgCustomProperty_values_editable_by) + val, err := n.GetEnumValue(ParseCustomProperty_values_editable_by) if err != nil { return err } if val != nil { - m.SetValuesEditableBy(val.(*OrgCustomProperty_values_editable_by)) + m.SetValuesEditableBy(val.(*CustomProperty_values_editable_by)) } return nil } @@ -210,26 +222,31 @@ func (m *OrgCustomProperty) GetFieldDeserializers()(map[string]func(i878a80d2330 } // GetPropertyName gets the property_name property value. The name of the property // returns a *string when successful -func (m *OrgCustomProperty) GetPropertyName()(*string) { +func (m *CustomProperty) 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) { +func (m *CustomProperty) GetRequired()(*bool) { return m.required } +// GetUrl gets the url property value. The URL that can be used to fetch, update, or delete info about this property via the API. +// returns a *string when successful +func (m *CustomProperty) GetUrl()(*string) { + return m.url +} // 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) { +// returns a *CustomProperty_values_editable_by when successful +func (m *CustomProperty) GetValuesEditableBy()(*CustomProperty_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) { +// returns a *CustomProperty_value_type when successful +func (m *CustomProperty) GetValueType()(*CustomProperty_value_type) { return m.value_type } // Serialize serializes information the current object -func (m *OrgCustomProperty) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { +func (m *CustomProperty) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { if m.GetAllowedValues() != nil { err := writer.WriteCollectionOfStringValues("allowed_values", m.GetAllowedValues()) if err != nil { @@ -260,6 +277,12 @@ func (m *OrgCustomProperty) Serialize(writer i878a80d2330e89d26896388a3f487eef27 return err } } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } if m.GetValuesEditableBy() != nil { cast := (*m.GetValuesEditableBy()).String() err := writer.WriteStringValue("values_editable_by", &cast) @@ -283,52 +306,58 @@ func (m *OrgCustomProperty) Serialize(writer i878a80d2330e89d26896388a3f487eef27 return nil } // SetAdditionalData sets the 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)() { +func (m *CustomProperty) 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)() { +func (m *CustomProperty) 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)() { +func (m *CustomProperty) SetDefaultValue(value CustomProperty_CustomProperty_default_valueable)() { m.default_value = value } // SetDescription sets the description property value. Short description of the property -func (m *OrgCustomProperty) SetDescription(value *string)() { +func (m *CustomProperty) SetDescription(value *string)() { m.description = value } // SetPropertyName sets the property_name property value. The name of the property -func (m *OrgCustomProperty) SetPropertyName(value *string)() { +func (m *CustomProperty) SetPropertyName(value *string)() { m.property_name = value } // SetRequired sets the required property value. Whether the property is required. -func (m *OrgCustomProperty) SetRequired(value *bool)() { +func (m *CustomProperty) SetRequired(value *bool)() { m.required = value } +// SetUrl sets the url property value. The URL that can be used to fetch, update, or delete info about this property via the API. +func (m *CustomProperty) SetUrl(value *string)() { + m.url = 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)() { +func (m *CustomProperty) SetValuesEditableBy(value *CustomProperty_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)() { +func (m *CustomProperty) SetValueType(value *CustomProperty_value_type)() { m.value_type = value } -type OrgCustomPropertyable interface { +type CustomPropertyable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetAllowedValues()([]string) - GetDefaultValue()(OrgCustomProperty_OrgCustomProperty_default_valueable) + GetDefaultValue()(CustomProperty_CustomProperty_default_valueable) GetDescription()(*string) GetPropertyName()(*string) GetRequired()(*bool) - GetValuesEditableBy()(*OrgCustomProperty_values_editable_by) - GetValueType()(*OrgCustomProperty_value_type) + GetUrl()(*string) + GetValuesEditableBy()(*CustomProperty_values_editable_by) + GetValueType()(*CustomProperty_value_type) SetAllowedValues(value []string)() - SetDefaultValue(value OrgCustomProperty_OrgCustomProperty_default_valueable)() + SetDefaultValue(value CustomProperty_CustomProperty_default_valueable)() SetDescription(value *string)() SetPropertyName(value *string)() SetRequired(value *bool)() - SetValuesEditableBy(value *OrgCustomProperty_values_editable_by)() - SetValueType(value *OrgCustomProperty_value_type)() + SetUrl(value *string)() + SetValuesEditableBy(value *CustomProperty_values_editable_by)() + SetValueType(value *CustomProperty_value_type)() } diff --git a/pkg/github/models/custom_property_value_type.go b/pkg/github/models/custom_property_value_type.go new file mode 100644 index 00000000..2554677b --- /dev/null +++ b/pkg/github/models/custom_property_value_type.go @@ -0,0 +1,43 @@ +package models +import ( + "errors" +) +// The type of the value for the property +type CustomProperty_value_type int + +const ( + STRING_CUSTOMPROPERTY_VALUE_TYPE CustomProperty_value_type = iota + SINGLE_SELECT_CUSTOMPROPERTY_VALUE_TYPE + MULTI_SELECT_CUSTOMPROPERTY_VALUE_TYPE + TRUE_FALSE_CUSTOMPROPERTY_VALUE_TYPE +) + +func (i CustomProperty_value_type) String() string { + return []string{"string", "single_select", "multi_select", "true_false"}[i] +} +func ParseCustomProperty_value_type(v string) (any, error) { + result := STRING_CUSTOMPROPERTY_VALUE_TYPE + switch v { + case "string": + result = STRING_CUSTOMPROPERTY_VALUE_TYPE + case "single_select": + result = SINGLE_SELECT_CUSTOMPROPERTY_VALUE_TYPE + case "multi_select": + result = MULTI_SELECT_CUSTOMPROPERTY_VALUE_TYPE + case "true_false": + result = TRUE_FALSE_CUSTOMPROPERTY_VALUE_TYPE + default: + return 0, errors.New("Unknown CustomProperty_value_type value: " + v) + } + return &result, nil +} +func SerializeCustomProperty_value_type(values []CustomProperty_value_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CustomProperty_value_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/custom_property_values_editable_by.go b/pkg/github/models/custom_property_values_editable_by.go new file mode 100644 index 00000000..f26e6e2e --- /dev/null +++ b/pkg/github/models/custom_property_values_editable_by.go @@ -0,0 +1,37 @@ +package models +import ( + "errors" +) +// Who can edit the values of the property +type CustomProperty_values_editable_by int + +const ( + ORG_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY CustomProperty_values_editable_by = iota + ORG_AND_REPO_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY +) + +func (i CustomProperty_values_editable_by) String() string { + return []string{"org_actors", "org_and_repo_actors"}[i] +} +func ParseCustomProperty_values_editable_by(v string) (any, error) { + result := ORG_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY + switch v { + case "org_actors": + result = ORG_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY + case "org_and_repo_actors": + result = ORG_AND_REPO_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY + default: + return 0, errors.New("Unknown CustomProperty_values_editable_by value: " + v) + } + return &result, nil +} +func SerializeCustomProperty_values_editable_by(values []CustomProperty_values_editable_by) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CustomProperty_values_editable_by) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/org_custom_property_value_type.go b/pkg/github/models/org_custom_property_value_type.go deleted file mode 100644 index 7ad5c0ce..00000000 --- a/pkg/github/models/org_custom_property_value_type.go +++ /dev/null @@ -1,43 +0,0 @@ -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/pkg/github/models/org_custom_property_values_editable_by.go b/pkg/github/models/org_custom_property_values_editable_by.go deleted file mode 100644 index a21cfec6..00000000 --- a/pkg/github/models/org_custom_property_values_editable_by.go +++ /dev/null @@ -1,37 +0,0 @@ -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/pkg/github/models/secret_scanning_push_protection_bypass.go b/pkg/github/models/secret_scanning_push_protection_bypass.go new file mode 100644 index 00000000..2fe0b26c --- /dev/null +++ b/pkg/github/models/secret_scanning_push_protection_bypass.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecretScanningPushProtectionBypass struct { + // 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 bypass will expire in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + expire_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The reason for bypassing push protection. + reason *SecretScanningPushProtectionBypassReason + // The token type this bypass is for. + token_type *string +} +// NewSecretScanningPushProtectionBypass instantiates a new SecretScanningPushProtectionBypass and sets the default values. +func NewSecretScanningPushProtectionBypass()(*SecretScanningPushProtectionBypass) { + m := &SecretScanningPushProtectionBypass{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningPushProtectionBypassFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningPushProtectionBypassFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningPushProtectionBypass(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *SecretScanningPushProtectionBypass) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExpireAt gets the expire_at property value. The time that the bypass will expire in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *SecretScanningPushProtectionBypass) GetExpireAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expire_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningPushProtectionBypass) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["expire_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpireAt(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningPushProtectionBypassReason) + if err != nil { + return err + } + if val != nil { + m.SetReason(val.(*SecretScanningPushProtectionBypassReason)) + } + return nil + } + res["token_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenType(val) + } + return nil + } + return res +} +// GetReason gets the reason property value. The reason for bypassing push protection. +// returns a *SecretScanningPushProtectionBypassReason when successful +func (m *SecretScanningPushProtectionBypass) GetReason()(*SecretScanningPushProtectionBypassReason) { + return m.reason +} +// GetTokenType gets the token_type property value. The token type this bypass is for. +// returns a *string when successful +func (m *SecretScanningPushProtectionBypass) GetTokenType()(*string) { + return m.token_type +} +// Serialize serializes information the current object +func (m *SecretScanningPushProtectionBypass) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("expire_at", m.GetExpireAt()) + if err != nil { + return err + } + } + if m.GetReason() != nil { + cast := (*m.GetReason()).String() + err := writer.WriteStringValue("reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_type", m.GetTokenType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SecretScanningPushProtectionBypass) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExpireAt sets the expire_at property value. The time that the bypass will expire in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *SecretScanningPushProtectionBypass) SetExpireAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expire_at = value +} +// SetReason sets the reason property value. The reason for bypassing push protection. +func (m *SecretScanningPushProtectionBypass) SetReason(value *SecretScanningPushProtectionBypassReason)() { + m.reason = value +} +// SetTokenType sets the token_type property value. The token type this bypass is for. +func (m *SecretScanningPushProtectionBypass) SetTokenType(value *string)() { + m.token_type = value +} +type SecretScanningPushProtectionBypassable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpireAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReason()(*SecretScanningPushProtectionBypassReason) + GetTokenType()(*string) + SetExpireAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReason(value *SecretScanningPushProtectionBypassReason)() + SetTokenType(value *string)() +} diff --git a/pkg/github/models/secret_scanning_push_protection_bypass503_error.go b/pkg/github/models/secret_scanning_push_protection_bypass503_error.go new file mode 100644 index 00000000..7417ce2c --- /dev/null +++ b/pkg/github/models/secret_scanning_push_protection_bypass503_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 SecretScanningPushProtectionBypass503Error 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 +} +// NewSecretScanningPushProtectionBypass503Error instantiates a new SecretScanningPushProtectionBypass503Error and sets the default values. +func NewSecretScanningPushProtectionBypass503Error()(*SecretScanningPushProtectionBypass503Error) { + m := &SecretScanningPushProtectionBypass503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningPushProtectionBypass503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningPushProtectionBypass503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningPushProtectionBypass503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *SecretScanningPushProtectionBypass503Error) 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 *SecretScanningPushProtectionBypass503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *SecretScanningPushProtectionBypass503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *SecretScanningPushProtectionBypass503Error) 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 *SecretScanningPushProtectionBypass503Error) 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 *SecretScanningPushProtectionBypass503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *SecretScanningPushProtectionBypass503Error) 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 *SecretScanningPushProtectionBypass503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *SecretScanningPushProtectionBypass503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *SecretScanningPushProtectionBypass503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *SecretScanningPushProtectionBypass503Error) SetMessage(value *string)() { + m.message = value +} +type SecretScanningPushProtectionBypass503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/models/secret_scanning_push_protection_bypass_reason.go b/pkg/github/models/secret_scanning_push_protection_bypass_reason.go new file mode 100644 index 00000000..2ff0fd7d --- /dev/null +++ b/pkg/github/models/secret_scanning_push_protection_bypass_reason.go @@ -0,0 +1,40 @@ +package models +import ( + "errors" +) +// The reason for bypassing push protection. +type SecretScanningPushProtectionBypassReason int + +const ( + FALSE_POSITIVE_SECRETSCANNINGPUSHPROTECTIONBYPASSREASON SecretScanningPushProtectionBypassReason = iota + USED_IN_TESTS_SECRETSCANNINGPUSHPROTECTIONBYPASSREASON + WILL_FIX_LATER_SECRETSCANNINGPUSHPROTECTIONBYPASSREASON +) + +func (i SecretScanningPushProtectionBypassReason) String() string { + return []string{"false_positive", "used_in_tests", "will_fix_later"}[i] +} +func ParseSecretScanningPushProtectionBypassReason(v string) (any, error) { + result := FALSE_POSITIVE_SECRETSCANNINGPUSHPROTECTIONBYPASSREASON + switch v { + case "false_positive": + result = FALSE_POSITIVE_SECRETSCANNINGPUSHPROTECTIONBYPASSREASON + case "used_in_tests": + result = USED_IN_TESTS_SECRETSCANNINGPUSHPROTECTIONBYPASSREASON + case "will_fix_later": + result = WILL_FIX_LATER_SECRETSCANNINGPUSHPROTECTIONBYPASSREASON + default: + return 0, errors.New("Unknown SecretScanningPushProtectionBypassReason value: " + v) + } + return &result, nil +} +func SerializeSecretScanningPushProtectionBypassReason(values []SecretScanningPushProtectionBypassReason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecretScanningPushProtectionBypassReason) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependency_graph_autosubmit_action.go b/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependency_graph_autosubmit_action.go new file mode 100644 index 00000000..3c63560a --- /dev/null +++ b/pkg/github/orgs/item/codesecurity/configurations/configurations_post_request_body_dependency_graph_autosubmit_action.go @@ -0,0 +1,40 @@ +package configurations +import ( + "errors" +) +// The enablement status of Automatic dependency submission +type ConfigurationsPostRequestBody_dependency_graph_autosubmit_action int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION ConfigurationsPostRequestBody_dependency_graph_autosubmit_action = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION +) + +func (i ConfigurationsPostRequestBody_dependency_graph_autosubmit_action) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_dependency_graph_autosubmit_action(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + default: + return 0, errors.New("Unknown ConfigurationsPostRequestBody_dependency_graph_autosubmit_action value: " + v) + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_dependency_graph_autosubmit_action(values []ConfigurationsPostRequestBody_dependency_graph_autosubmit_action) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_dependency_graph_autosubmit_action) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/codesecurity/configurations/item/with_configuration_patch_request_body_dependency_graph_autosubmit_action.go b/pkg/github/orgs/item/codesecurity/configurations/item/with_configuration_patch_request_body_dependency_graph_autosubmit_action.go new file mode 100644 index 00000000..4781d3e5 --- /dev/null +++ b/pkg/github/orgs/item/codesecurity/configurations/item/with_configuration_patch_request_body_dependency_graph_autosubmit_action.go @@ -0,0 +1,40 @@ +package item +import ( + "errors" +) +// The enablement status of Automatic dependency submission +type WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION +) + +func (i WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH_AUTOSUBMIT_ACTION + default: + return 0, errors.New("Unknown WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action value: " + v) + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action(values []WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body.go b/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body.go index e3740858..12463397 100644 --- a/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body.go +++ b/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body.go @@ -5,6 +5,8 @@ import ( ) type ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody struct { + // Feature options for Automatic dependency submission + dependency_graph_autosubmit_action_options ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable // A description of the code security configuration description *string // The name of the code security configuration. Must be unique within the organization. @@ -21,6 +23,11 @@ func NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody()(* func CreateItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody(), nil } +// GetDependencyGraphAutosubmitActionOptions gets the dependency_graph_autosubmit_action_options property value. Feature options for Automatic dependency submission +// returns a ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) GetDependencyGraphAutosubmitActionOptions()(ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable) { + return m.dependency_graph_autosubmit_action_options +} // GetDescription gets the description property value. A description of the code security configuration // returns a *string when successful func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) GetDescription()(*string) { @@ -30,6 +37,16 @@ func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) G // 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["dependency_graph_autosubmit_action_options"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependencyGraphAutosubmitActionOptions(val.(ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable)) + } + return nil + } res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { @@ -59,6 +76,12 @@ func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) G } // Serialize serializes information the current object func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dependency_graph_autosubmit_action_options", m.GetDependencyGraphAutosubmitActionOptions()) + if err != nil { + return err + } + } { err := writer.WriteStringValue("description", m.GetDescription()) if err != nil { @@ -73,6 +96,10 @@ func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) S } return nil } +// SetDependencyGraphAutosubmitActionOptions sets the dependency_graph_autosubmit_action_options property value. Feature options for Automatic dependency submission +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) SetDependencyGraphAutosubmitActionOptions(value ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable)() { + m.dependency_graph_autosubmit_action_options = value +} // SetDescription sets the description property value. A description of the code security configuration func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) SetDescription(value *string)() { m.description = value @@ -83,8 +110,10 @@ func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) S } type ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDependencyGraphAutosubmitActionOptions()(ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable) GetDescription()(*string) GetName()(*string) + SetDependencyGraphAutosubmitActionOptions(value ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable)() SetDescription(value *string)() SetName(value *string)() } diff --git a/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body_dependency_graph_autosubmit_action_options.go b/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body_dependency_graph_autosubmit_action_options.go new file mode 100644 index 00000000..d67c0599 --- /dev/null +++ b/pkg/github/orgs/item_code_security_configurations_item_with_configuration_patch_request_body_dependency_graph_autosubmit_action_options.go @@ -0,0 +1,81 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options feature options for Automatic dependency submission +type ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options 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 use runners labeled with 'dependency-submission' or standard GitHub runners. + labeled_runners *bool +} +// NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options instantiates a new ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options and sets the default values. +func NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options()(*ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options) { + m := &ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labeled_runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLabeledRunners(val) + } + return nil + } + return res +} +// GetLabeledRunners gets the labeled_runners property value. Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. +// returns a *bool when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options) GetLabeledRunners()(*bool) { + return m.labeled_runners +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("labeled_runners", m.GetLabeledRunners()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabeledRunners sets the labeled_runners property value. Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_options) SetLabeledRunners(value *bool)() { + m.labeled_runners = value +} +type ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabeledRunners()(*bool) + SetLabeledRunners(value *bool)() +} diff --git a/pkg/github/orgs/item_code_security_configurations_post_request_body.go b/pkg/github/orgs/item_code_security_configurations_post_request_body.go index b2356378..648f4bda 100644 --- a/pkg/github/orgs/item_code_security_configurations_post_request_body.go +++ b/pkg/github/orgs/item_code_security_configurations_post_request_body.go @@ -5,6 +5,8 @@ import ( ) type ItemCodeSecurityConfigurationsPostRequestBody struct { + // Feature options for Automatic dependency submission + dependency_graph_autosubmit_action_options ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable // A description of the code security configuration description *string // The name of the code security configuration. Must be unique within the organization. @@ -21,6 +23,11 @@ func NewItemCodeSecurityConfigurationsPostRequestBody()(*ItemCodeSecurityConfigu func CreateItemCodeSecurityConfigurationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { return NewItemCodeSecurityConfigurationsPostRequestBody(), nil } +// GetDependencyGraphAutosubmitActionOptions gets the dependency_graph_autosubmit_action_options property value. Feature options for Automatic dependency submission +// returns a ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetDependencyGraphAutosubmitActionOptions()(ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable) { + return m.dependency_graph_autosubmit_action_options +} // GetDescription gets the description property value. A description of the code security configuration // returns a *string when successful func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetDescription()(*string) { @@ -30,6 +37,16 @@ func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetDescription()(*string // 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["dependency_graph_autosubmit_action_options"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependencyGraphAutosubmitActionOptions(val.(ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable)) + } + return nil + } res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { @@ -59,6 +76,12 @@ func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetName()(*string) { } // Serialize serializes information the current object func (m *ItemCodeSecurityConfigurationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dependency_graph_autosubmit_action_options", m.GetDependencyGraphAutosubmitActionOptions()) + if err != nil { + return err + } + } { err := writer.WriteStringValue("description", m.GetDescription()) if err != nil { @@ -73,6 +96,10 @@ func (m *ItemCodeSecurityConfigurationsPostRequestBody) Serialize(writer i878a80 } return nil } +// SetDependencyGraphAutosubmitActionOptions sets the dependency_graph_autosubmit_action_options property value. Feature options for Automatic dependency submission +func (m *ItemCodeSecurityConfigurationsPostRequestBody) SetDependencyGraphAutosubmitActionOptions(value ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable)() { + m.dependency_graph_autosubmit_action_options = value +} // SetDescription sets the description property value. A description of the code security configuration func (m *ItemCodeSecurityConfigurationsPostRequestBody) SetDescription(value *string)() { m.description = value @@ -83,8 +110,10 @@ func (m *ItemCodeSecurityConfigurationsPostRequestBody) SetName(value *string)() } type ItemCodeSecurityConfigurationsPostRequestBodyable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDependencyGraphAutosubmitActionOptions()(ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable) GetDescription()(*string) GetName()(*string) + SetDependencyGraphAutosubmitActionOptions(value ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable)() SetDescription(value *string)() SetName(value *string)() } diff --git a/pkg/github/orgs/item_code_security_configurations_post_request_body_dependency_graph_autosubmit_action_options.go b/pkg/github/orgs/item_code_security_configurations_post_request_body_dependency_graph_autosubmit_action_options.go new file mode 100644 index 00000000..de18c677 --- /dev/null +++ b/pkg/github/orgs/item_code_security_configurations_post_request_body_dependency_graph_autosubmit_action_options.go @@ -0,0 +1,81 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options feature options for Automatic dependency submission +type ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options 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 use runners labeled with 'dependency-submission' or standard GitHub runners. + labeled_runners *bool +} +// NewItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options instantiates a new ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options and sets the default values. +func NewItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options()(*ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options) { + m := &ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labeled_runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLabeledRunners(val) + } + return nil + } + return res +} +// GetLabeledRunners gets the labeled_runners property value. Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. +// returns a *bool when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options) GetLabeledRunners()(*bool) { + return m.labeled_runners +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("labeled_runners", m.GetLabeledRunners()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabeledRunners sets the labeled_runners property value. Whether to use runners labeled with 'dependency-submission' or standard GitHub runners. +func (m *ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_options) SetLabeledRunners(value *bool)() { + m.labeled_runners = value +} +type ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabeledRunners()(*bool) + SetLabeledRunners(value *bool)() +} diff --git a/pkg/github/orgs/item_properties_schema_patch_request_body.go b/pkg/github/orgs/item_properties_schema_patch_request_body.go index c426848e..777d1d29 100644 --- a/pkg/github/orgs/item_properties_schema_patch_request_body.go +++ b/pkg/github/orgs/item_properties_schema_patch_request_body.go @@ -9,7 +9,7 @@ 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 + properties []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable } // NewItemPropertiesSchemaPatchRequestBody instantiates a new ItemPropertiesSchemaPatchRequestBody and sets the default values. func NewItemPropertiesSchemaPatchRequestBody()(*ItemPropertiesSchemaPatchRequestBody) { @@ -33,15 +33,15 @@ func (m *ItemPropertiesSchemaPatchRequestBody) GetAdditionalData()(map[string]an 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) + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCustomPropertyFromDiscriminatorValue) if err != nil { return err } if val != nil { - res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, len(val)) + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable, len(val)) for i, v := range val { if v != nil { - res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable) + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable) } } m.SetProperties(res) @@ -51,8 +51,8 @@ func (m *ItemPropertiesSchemaPatchRequestBody) GetFieldDeserializers()(map[strin 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) { +// returns a []CustomPropertyable when successful +func (m *ItemPropertiesSchemaPatchRequestBody) GetProperties()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable) { return m.properties } // Serialize serializes information the current object @@ -82,12 +82,12 @@ func (m *ItemPropertiesSchemaPatchRequestBody) SetAdditionalData(value map[strin 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)() { +func (m *ItemPropertiesSchemaPatchRequestBody) SetProperties(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable)() { m.properties = value } type ItemPropertiesSchemaPatchRequestBodyable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable - GetProperties()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable) - SetProperties(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable)() + GetProperties()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable) + SetProperties(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable)() } diff --git a/pkg/github/orgs/item_properties_schema_request_builder.go b/pkg/github/orgs/item_properties_schema_request_builder.go index 2f924b9a..6634e6df 100644 --- a/pkg/github/orgs/item_properties_schema_request_builder.go +++ b/pkg/github/orgs/item_properties_schema_request_builder.go @@ -36,13 +36,13 @@ func NewItemPropertiesSchemaRequestBuilder(rawUrl string, requestAdapter i2ae418 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 []CustomPropertyable 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) { +func (m *ItemPropertiesSchemaRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable, error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { return nil, err @@ -51,26 +51,26 @@ func (m *ItemPropertiesSchemaRequestBuilder) Get(ctx context.Context, requestCon "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, } - res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgCustomPropertyFromDiscriminatorValue, errorMapping) + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCustomPropertyFromDiscriminatorValue, errorMapping) if err != nil { return nil, err } - val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, len(res)) + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable, len(res)) for i, v := range res { if v != nil { - val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable) + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable) } } 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 []CustomPropertyable 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) { +func (m *ItemPropertiesSchemaRequestBuilder) Patch(ctx context.Context, body ItemPropertiesSchemaPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable, error) { requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); if err != nil { return nil, err @@ -79,14 +79,14 @@ func (m *ItemPropertiesSchemaRequestBuilder) Patch(ctx context.Context, body Ite "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, } - res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgCustomPropertyFromDiscriminatorValue, errorMapping) + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCustomPropertyFromDiscriminatorValue, errorMapping) if err != nil { return nil, err } - val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable, len(res)) + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable, len(res)) for i, v := range res { if v != nil { - val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable) + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable) } } return val, nil diff --git a/pkg/github/orgs/item_properties_schema_with_custom_property_name_item_request_builder.go b/pkg/github/orgs/item_properties_schema_with_custom_property_name_item_request_builder.go index 7159b94d..615a0112 100644 --- a/pkg/github/orgs/item_properties_schema_with_custom_property_name_item_request_builder.go +++ b/pkg/github/orgs/item_properties_schema_with_custom_property_name_item_request_builder.go @@ -45,13 +45,13 @@ func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Delete( 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 CustomPropertyable 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) { +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable, error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); if err != nil { return nil, err @@ -60,23 +60,23 @@ func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Get(ctx "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, } - res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgCustomPropertyFromDiscriminatorValue, errorMapping) + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCustomPropertyFromDiscriminatorValue, errorMapping) if err != nil { return nil, err } if res == nil { return nil, nil } - return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable), nil + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable), 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 CustomPropertyable 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) { +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Put(ctx context.Context, body ItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable, error) { requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); if err != nil { return nil, err @@ -85,14 +85,14 @@ func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Put(ctx "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, } - res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgCustomPropertyFromDiscriminatorValue, errorMapping) + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCustomPropertyFromDiscriminatorValue, errorMapping) if err != nil { return nil, err } if res == nil { return nil, nil } - return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgCustomPropertyable), nil + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable), 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 diff --git a/pkg/github/orgs/item_team_item_copilot_request_builder.go b/pkg/github/orgs/item_team_item_copilot_request_builder.go new file mode 100644 index 00000000..184e910c --- /dev/null +++ b/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/pkg/github/orgs/item_team_item_copilot_usage_request_builder.go b/pkg/github/orgs/item_team_item_copilot_usage_request_builder.go new file mode 100644 index 00000000..4f92d05c --- /dev/null +++ b/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 up to 28 days prior. 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 with active Copilot licenses, as evaluated at the end of that day.Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.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 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 up to 28 days prior. 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 with active Copilot licenses, as evaluated at the end of that day.Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.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-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 up to 28 days prior. 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 with active Copilot licenses, as evaluated at the end of that day.Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.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 *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/pkg/github/orgs/item_team_request_builder.go b/pkg/github/orgs/item_team_request_builder.go new file mode 100644 index 00000000..abe992b6 --- /dev/null +++ b/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/pkg/github/orgs/item_team_with_team_slug_item_request_builder.go b/pkg/github/orgs/item_team_with_team_slug_item_request_builder.go new file mode 100644 index 00000000..744397dd --- /dev/null +++ b/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/pkg/github/orgs/with_org_item_request_builder.go b/pkg/github/orgs/with_org_item_request_builder.go index 1a2fdf3d..bdcdd406 100644 --- a/pkg/github/orgs/with_org_item_request_builder.go +++ b/pkg/github/orgs/with_org_item_request_builder.go @@ -276,6 +276,11 @@ func (m *WithOrgItemRequestBuilder) SecurityManagers()(*ItemSecurityManagersRequ func (m *WithOrgItemRequestBuilder) Settings()(*ItemSettingsRequestBuilder) { return NewItemSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Team the team property +// returns a *ItemTeamRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Team()(*ItemTeamRequestBuilder) { + return NewItemTeamRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} // Teams the teams property // returns a *ItemTeamsRequestBuilder when successful func (m *WithOrgItemRequestBuilder) Teams()(*ItemTeamsRequestBuilder) { diff --git a/pkg/github/repos/item_item_secret_scanning_push_protection_bypasses_post_request_body.go b/pkg/github/repos/item_item_secret_scanning_push_protection_bypasses_post_request_body.go new file mode 100644 index 00000000..90a91ac5 --- /dev/null +++ b/pkg/github/repos/item_item_secret_scanning_push_protection_bypasses_post_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 ItemItemSecretScanningPushProtectionBypassesPostRequestBody struct { + // 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 push protection bypass placeholder. This value is returned on any push protected routes. + placeholder_id *string + // The reason for bypassing push protection. + reason *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningPushProtectionBypassReason +} +// NewItemItemSecretScanningPushProtectionBypassesPostRequestBody instantiates a new ItemItemSecretScanningPushProtectionBypassesPostRequestBody and sets the default values. +func NewItemItemSecretScanningPushProtectionBypassesPostRequestBody()(*ItemItemSecretScanningPushProtectionBypassesPostRequestBody) { + m := &ItemItemSecretScanningPushProtectionBypassesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemSecretScanningPushProtectionBypassesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemSecretScanningPushProtectionBypassesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemSecretScanningPushProtectionBypassesPostRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemSecretScanningPushProtectionBypassesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemSecretScanningPushProtectionBypassesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["placeholder_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPlaceholderId(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.ParseSecretScanningPushProtectionBypassReason) + if err != nil { + return err + } + if val != nil { + m.SetReason(val.(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningPushProtectionBypassReason)) + } + return nil + } + return res +} +// GetPlaceholderId gets the placeholder_id property value. The ID of the push protection bypass placeholder. This value is returned on any push protected routes. +// returns a *string when successful +func (m *ItemItemSecretScanningPushProtectionBypassesPostRequestBody) GetPlaceholderId()(*string) { + return m.placeholder_id +} +// GetReason gets the reason property value. The reason for bypassing push protection. +// returns a *SecretScanningPushProtectionBypassReason when successful +func (m *ItemItemSecretScanningPushProtectionBypassesPostRequestBody) GetReason()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningPushProtectionBypassReason) { + return m.reason +} +// Serialize serializes information the current object +func (m *ItemItemSecretScanningPushProtectionBypassesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("placeholder_id", m.GetPlaceholderId()) + if err != nil { + return err + } + } + if m.GetReason() != nil { + cast := (*m.GetReason()).String() + err := writer.WriteStringValue("reason", &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 *ItemItemSecretScanningPushProtectionBypassesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPlaceholderId sets the placeholder_id property value. The ID of the push protection bypass placeholder. This value is returned on any push protected routes. +func (m *ItemItemSecretScanningPushProtectionBypassesPostRequestBody) SetPlaceholderId(value *string)() { + m.placeholder_id = value +} +// SetReason sets the reason property value. The reason for bypassing push protection. +func (m *ItemItemSecretScanningPushProtectionBypassesPostRequestBody) SetReason(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningPushProtectionBypassReason)() { + m.reason = value +} +type ItemItemSecretScanningPushProtectionBypassesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPlaceholderId()(*string) + GetReason()(*i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningPushProtectionBypassReason) + SetPlaceholderId(value *string)() + SetReason(value *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningPushProtectionBypassReason)() +} diff --git a/pkg/github/repos/item_item_secret_scanning_push_protection_bypasses_request_builder.go b/pkg/github/repos/item_item_secret_scanning_push_protection_bypasses_request_builder.go new file mode 100644 index 00000000..938fe6a2 --- /dev/null +++ b/pkg/github/repos/item_item_secret_scanning_push_protection_bypasses_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" +) + +// ItemItemSecretScanningPushProtectionBypassesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning\push-protection-bypasses +type ItemItemSecretScanningPushProtectionBypassesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemSecretScanningPushProtectionBypassesRequestBuilderInternal instantiates a new ItemItemSecretScanningPushProtectionBypassesRequestBuilder and sets the default values. +func NewItemItemSecretScanningPushProtectionBypassesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningPushProtectionBypassesRequestBuilder) { + m := &ItemItemSecretScanningPushProtectionBypassesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning/push-protection-bypasses", pathParameters), + } + return m +} +// NewItemItemSecretScanningPushProtectionBypassesRequestBuilder instantiates a new ItemItemSecretScanningPushProtectionBypassesRequestBuilder and sets the default values. +func NewItemItemSecretScanningPushProtectionBypassesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningPushProtectionBypassesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecretScanningPushProtectionBypassesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a bypass for a previously push protected secret.The authenticated user must be the original author of the committed secret.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a SecretScanningPushProtectionBypassable when successful +// returns a SecretScanningPushProtectionBypass503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass +func (m *ItemItemSecretScanningPushProtectionBypassesRequestBuilder) Post(ctx context.Context, body ItemItemSecretScanningPushProtectionBypassesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningPushProtectionBypassable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSecretScanningPushProtectionBypass503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateSecretScanningPushProtectionBypassFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SecretScanningPushProtectionBypassable), nil +} +// ToPostRequestInformation creates a bypass for a previously push protected secret.The authenticated user must be the original author of the committed secret.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemSecretScanningPushProtectionBypassesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemSecretScanningPushProtectionBypassesPostRequestBodyable, 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 *ItemItemSecretScanningPushProtectionBypassesRequestBuilder when successful +func (m *ItemItemSecretScanningPushProtectionBypassesRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecretScanningPushProtectionBypassesRequestBuilder) { + return NewItemItemSecretScanningPushProtectionBypassesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_secret_scanning_request_builder.go b/pkg/github/repos/item_item_secret_scanning_request_builder.go index 6231e771..bbb693f7 100644 --- a/pkg/github/repos/item_item_secret_scanning_request_builder.go +++ b/pkg/github/repos/item_item_secret_scanning_request_builder.go @@ -26,3 +26,8 @@ func NewItemItemSecretScanningRequestBuilder(rawUrl string, requestAdapter i2ae4 urlParams["request-raw-url"] = rawUrl return NewItemItemSecretScanningRequestBuilderInternal(urlParams, requestAdapter) } +// PushProtectionBypasses the pushProtectionBypasses property +// returns a *ItemItemSecretScanningPushProtectionBypassesRequestBuilder when successful +func (m *ItemItemSecretScanningRequestBuilder) PushProtectionBypasses()(*ItemItemSecretScanningPushProtectionBypassesRequestBuilder) { + return NewItemItemSecretScanningPushProtectionBypassesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +}