From 5fcaee59ddea042bbb4af117abd2793b2fb6eefe Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Mon, 23 Dec 2024 10:33:16 -0800 Subject: [PATCH] feat: Updates to generated code --- ...d943440e0d0dca372206b2a94243699af7e2f41.go | 81 +++++ ...833bdd0a1ecd1b8f04595c0effd49920442befd.go | 81 +++++ ...4ba411c26734097806fff4ad4cb1deb326610ef.go | 37 +++ ..._body_escaped_advanced_escaped_security.go | 34 ++ ..._scanning_escaped_default_escaped_setup.go | 37 +++ ..._body_escaped_dependabot_escaped_alerts.go | 37 +++ ...ndabot_escaped_security_escaped_updates.go | 37 +++ ...t_body_escaped_dependency_escaped_graph.go | 37 +++ ...graph_escaped_autosubmit_escaped_action.go | 37 +++ ...s_post_request_body_escaped_enforcement.go | 34 ++ ...escaped_vulnerability_escaped_reporting.go | 37 +++ ...st_body_escaped_secret_escaped_scanning.go | 37 +++ ...canning_escaped_push_escaped_protection.go | 37 +++ ...canning_escaped_validity_escaped_checks.go | 37 +++ ...46e55b00ace3da6cc3b9dc11b819837b65bf7f6.go | 37 +++ ...1a623fda6e62b3c67b501f55bf37eb9639d8e89.go | 37 +++ ...db3f714b827767b9b2496c2c2686b6d8ef3755f.go | 37 +++ .../attach_post_request_body_escaped_scope.go | 34 ++ ...t_escaped_for_escaped_new_escaped_repos.go | 40 +++ ...t_escaped_for_escaped_new_escaped_repos.go | 40 +++ ...4d4a65b0e38b27a546d2a4303db86085c4c4129.go | 37 +++ ...dd10d21cd84b3cb7b6761b14c5473867a116ec1.go | 37 +++ ...d4656064a4037c7bd83a17eb2c78011484ce063.go | 37 +++ ..._body_escaped_advanced_escaped_security.go | 34 ++ ..._body_escaped_dependabot_escaped_alerts.go | 37 +++ ...ndabot_escaped_security_escaped_updates.go | 37 +++ ...t_body_escaped_dependency_escaped_graph.go | 37 +++ ..._patch_request_body_escaped_enforcement.go | 34 ++ ...st_body_escaped_secret_escaped_scanning.go | 37 +++ ...configurations_defaults_request_builder.go | 60 ++++ ...gurations_item_attach_post_request_body.go | 32 ++ ...onfigurations_item_attach_post_response.go | 51 +++ ...figurations_item_attach_request_builder.go | 69 ++++ ...urations_item_defaults_put_request_body.go | 51 +++ ...nfigurations_item_defaults_put_response.go | 81 +++++ ...gurations_item_defaults_request_builder.go | 67 ++++ ...tions_item_repositories_request_builder.go | 77 +++++ ...onfiguration_escaped_patch_request_body.go | 149 +++++++++ ...curity_configurations_post_request_body.go | 149 +++++++++ ...security_configurations_request_builder.go | 130 ++++++++ ...figuration_escaped_item_request_builder.go | 150 +++++++++ .../item_code_security_request_builder.go | 28 ++ .../item_copilot_billing_request_builder.go | 28 -- ...item_copilot_billing_seats_get_response.go | 122 ------- ...m_copilot_billing_seats_request_builder.go | 74 ----- .../item_copilot_metrics_request_builder.go | 81 ----- .../item_copilot_request_builder.go | 38 --- .../item_copilot_usage_request_builder.go | 81 ----- ..._secret_scanning_alerts_request_builder.go | 2 +- ...am_item_copilot_metrics_request_builder.go | 81 ----- .../item_team_item_copilot_request_builder.go | 33 -- ...team_item_copilot_usage_request_builder.go | 81 ----- .../enterprises/item_team_request_builder.go | 35 -- ..._team_escaped_slug_item_request_builder.go | 28 -- .../with_enterprise_item_request_builder.go | 15 +- pkg/github/kiota-lock.json | 2 +- .../models/api_overview_escaped_domains.go | 29 ++ ...domains_escaped_actions_escaped_inbound.go | 121 +++++++ pkg/github/models/code_scanning_autofix.go | 134 ++++++++ .../models/code_scanning_autofix503_error.go | 146 +++++++++ .../models/code_scanning_autofix_commits.go | 110 +++++++ .../code_scanning_autofix_commits_response.go | 109 +++++++ ...nning_autofix_commits_response503_error.go | 146 +++++++++ .../models/code_scanning_autofix_status.go | 40 +++ ...canning_default_setup_escaped_languages.go | 9 +- ..._default_setup_update_escaped_languages.go | 9 +- .../models/custom_property_set_payload.go | 304 ++++++++++++++++++ ..._set_payload_escaped_value_escaped_type.go | 40 +++ .../org_private_registry_configuration.go | 229 +++++++++++++ ...iguration_escaped_registry_escaped_type.go | 31 ++ ...gistry_configuration_escaped_visibility.go | 37 +++ ...onfiguration_with_selected_repositories.go | 264 +++++++++++++++ ...ositories_escaped_registry_escaped_type.go | 31 ++ ...elected_repositories_escaped_visibility.go | 37 +++ pkg/github/models/org_ruleset_conditions.go | 2 +- .../organization_secret_scanning_alert.go | 29 ++ .../rate_limit_overview_escaped_resources.go | 29 ++ ...ry_rule_pull_request_escaped_parameters.go | 35 ++ ...ory_ruleset_escaped_source_escaped_type.go | 5 +- .../repository_ruleset_escaped_target.go | 5 +- pkg/github/models/secret_scanning_alert.go | 29 ++ ...uest_body_escaped_registry_escaped_type.go | 31 ++ ...e_patch_request_body_escaped_visibility.go | 37 +++ ...uest_body_escaped_registry_escaped_type.go | 31 ++ ...es_post_request_body_escaped_visibility.go | 37 +++ ...request_body_escaped_value_escaped_type.go | 40 --- ...escaped_put_request_body_escaped_target.go | 5 +- ...lesets_post_request_body_escaped_target.go | 5 +- ...igest_get_response_escaped_attestations.go | 29 ++ .../item_private_registries_get_response.go | 122 +++++++ ..._secret_escaped_name_patch_request_body.go | 173 ++++++++++ ...em_private_registries_post_request_body.go | 173 ++++++++++ ...vate_registries_public_key_get_response.go | 109 +++++++ ...e_registries_public_key_request_builder.go | 61 ++++ ...item_private_registries_request_builder.go | 124 +++++++ ...ecret_escaped_name_item_request_builder.go | 123 +++++++ ..._property_escaped_name_put_request_body.go | 273 ---------------- ...perty_escaped_name_item_request_builder.go | 4 +- ...m_with_ruleset_escaped_put_request_body.go | 6 +- .../orgs/item_rulesets_post_request_body.go | 6 +- ..._secret_scanning_alerts_request_builder.go | 2 +- .../item_security_managers_request_builder.go | 7 +- ...security_managers_teams_request_builder.go | 1 + ..._team_escaped_slug_item_request_builder.go | 13 +- .../orgs/with_org_item_request_builder.go | 5 + ...igest_get_response_escaped_attestations.go | 29 ++ ...ts_item_autofix_commits_request_builder.go | 71 ++++ ...ing_alerts_item_autofix_request_builder.go | 109 +++++++ ...ert_escaped_number_item_request_builder.go | 5 + ..._secret_scanning_alerts_request_builder.go | 2 +- ...igest_get_response_escaped_attestations.go | 29 ++ 111 files changed, 5535 insertions(+), 1034 deletions(-) create mode 100644 pkg/github/enterprises/2b1b3026796140934c05f898ed943440e0d0dca372206b2a94243699af7e2f41.go create mode 100644 pkg/github/enterprises/baf6342a29aef677121e58b0d833bdd0a1ecd1b8f04595c0effd49920442befd.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/0377ba2251c94ba57e1f44e994ba411c26734097806fff4ad4cb1deb326610ef.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_advanced_escaped_security.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_code_escaped_scanning_escaped_default_escaped_setup.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependabot_escaped_alerts.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependabot_escaped_security_escaped_updates.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependency_escaped_graph.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependency_escaped_graph_escaped_autosubmit_escaped_action.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_enforcement.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_private_escaped_vulnerability_escaped_reporting.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning_escaped_push_escaped_protection.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning_escaped_validity_escaped_checks.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/2dd781707d3b0cc4f1cd9f16046e55b00ace3da6cc3b9dc11b819837b65bf7f6.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/6ebbeed57f232a4eb995f80331a623fda6e62b3c67b501f55bf37eb9639d8e89.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/9b6a045cea50d4d3b80c85099db3f714b827767b9b2496c2c2686b6d8ef3755f.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/attach/attach_post_request_body_escaped_scope.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/defaults/defaults_put_request_body_escaped_default_escaped_for_escaped_new_escaped_repos.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/defaults/defaults_put_response_escaped_default_escaped_for_escaped_new_escaped_repos.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/e5d0227cc898daa954d494c8a4d4a65b0e38b27a546d2a4303db86085c4c4129.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/e5fc1a3db286a5c7a2fd8cee0dd10d21cd84b3cb7b6761b14c5473867a116ec1.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/f8d7dd54ba95aae66631abec2d4656064a4037c7bd83a17eb2c78011484ce063.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_advanced_escaped_security.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependabot_escaped_alerts.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependabot_escaped_security_escaped_updates.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependency_escaped_graph.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_enforcement.go create mode 100644 pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_secret_escaped_scanning.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_defaults_request_builder.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_item_attach_post_request_body.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_item_attach_post_response.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_item_attach_request_builder.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_item_defaults_put_request_body.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_item_defaults_put_response.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_item_defaults_request_builder.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_item_repositories_request_builder.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_item_with_configuration_escaped_patch_request_body.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_post_request_body.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_request_builder.go create mode 100644 pkg/github/enterprises/item_code_security_configurations_with_configuration_escaped_item_request_builder.go create mode 100644 pkg/github/enterprises/item_code_security_request_builder.go delete mode 100644 pkg/github/enterprises/item_copilot_billing_request_builder.go delete mode 100644 pkg/github/enterprises/item_copilot_billing_seats_get_response.go delete mode 100644 pkg/github/enterprises/item_copilot_billing_seats_request_builder.go delete mode 100644 pkg/github/enterprises/item_copilot_metrics_request_builder.go delete mode 100644 pkg/github/enterprises/item_copilot_request_builder.go delete mode 100644 pkg/github/enterprises/item_copilot_usage_request_builder.go delete mode 100644 pkg/github/enterprises/item_team_item_copilot_metrics_request_builder.go delete mode 100644 pkg/github/enterprises/item_team_item_copilot_request_builder.go delete mode 100644 pkg/github/enterprises/item_team_item_copilot_usage_request_builder.go delete mode 100644 pkg/github/enterprises/item_team_request_builder.go delete mode 100644 pkg/github/enterprises/item_team_with_team_escaped_slug_item_request_builder.go create mode 100644 pkg/github/models/api_overview_escaped_domains_escaped_actions_escaped_inbound.go create mode 100644 pkg/github/models/code_scanning_autofix.go create mode 100644 pkg/github/models/code_scanning_autofix503_error.go create mode 100644 pkg/github/models/code_scanning_autofix_commits.go create mode 100644 pkg/github/models/code_scanning_autofix_commits_response.go create mode 100644 pkg/github/models/code_scanning_autofix_commits_response503_error.go create mode 100644 pkg/github/models/code_scanning_autofix_status.go create mode 100644 pkg/github/models/custom_property_set_payload.go create mode 100644 pkg/github/models/custom_property_set_payload_escaped_value_escaped_type.go create mode 100644 pkg/github/models/org_private_registry_configuration.go create mode 100644 pkg/github/models/org_private_registry_configuration_escaped_registry_escaped_type.go create mode 100644 pkg/github/models/org_private_registry_configuration_escaped_visibility.go create mode 100644 pkg/github/models/org_private_registry_configuration_with_selected_repositories.go create mode 100644 pkg/github/models/org_private_registry_configuration_with_selected_repositories_escaped_registry_escaped_type.go create mode 100644 pkg/github/models/org_private_registry_configuration_with_selected_repositories_escaped_visibility.go create mode 100644 pkg/github/orgs/item/privateregistries/item/with_secret_escaped_name_patch_request_body_escaped_registry_escaped_type.go create mode 100644 pkg/github/orgs/item/privateregistries/item/with_secret_escaped_name_patch_request_body_escaped_visibility.go create mode 100644 pkg/github/orgs/item/privateregistries/private_registries_post_request_body_escaped_registry_escaped_type.go create mode 100644 pkg/github/orgs/item/privateregistries/private_registries_post_request_body_escaped_visibility.go delete mode 100644 pkg/github/orgs/item/properties/schema/item/with_custom_escaped_property_escaped_name_put_request_body_escaped_value_escaped_type.go create mode 100644 pkg/github/orgs/item_private_registries_get_response.go create mode 100644 pkg/github/orgs/item_private_registries_item_with_secret_escaped_name_patch_request_body.go create mode 100644 pkg/github/orgs/item_private_registries_post_request_body.go create mode 100644 pkg/github/orgs/item_private_registries_public_key_get_response.go create mode 100644 pkg/github/orgs/item_private_registries_public_key_request_builder.go create mode 100644 pkg/github/orgs/item_private_registries_request_builder.go create mode 100644 pkg/github/orgs/item_private_registries_with_secret_escaped_name_item_request_builder.go delete mode 100644 pkg/github/orgs/item_properties_schema_item_with_custom_escaped_property_escaped_name_put_request_body.go create mode 100644 pkg/github/repos/item_item_code_scanning_alerts_item_autofix_commits_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_alerts_item_autofix_request_builder.go diff --git a/pkg/github/enterprises/2b1b3026796140934c05f898ed943440e0d0dca372206b2a94243699af7e2f41.go b/pkg/github/enterprises/2b1b3026796140934c05f898ed943440e0d0dca372206b2a94243699af7e2f41.go new file mode 100644 index 00000000..d504c95c --- /dev/null +++ b/pkg/github/enterprises/2b1b3026796140934c05f898ed943440e0d0dca372206b2a94243699af7e2f41.go @@ -0,0 +1,81 @@ +package enterprises + +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/enterprises/baf6342a29aef677121e58b0d833bdd0a1ecd1b8f04595c0effd49920442befd.go b/pkg/github/enterprises/baf6342a29aef677121e58b0d833bdd0a1ecd1b8f04595c0effd49920442befd.go new file mode 100644 index 00000000..2247202d --- /dev/null +++ b/pkg/github/enterprises/baf6342a29aef677121e58b0d833bdd0a1ecd1b8f04595c0effd49920442befd.go @@ -0,0 +1,81 @@ +package enterprises + +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/enterprises/item/codesecurity/configurations/0377ba2251c94ba57e1f44e994ba411c26734097806fff4ad4cb1deb326610ef.go b/pkg/github/enterprises/item/codesecurity/configurations/0377ba2251c94ba57e1f44e994ba411c26734097806fff4ad4cb1deb326610ef.go new file mode 100644 index 00000000..c90e7105 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/0377ba2251c94ba57e1f44e994ba411c26734097806fff4ad4cb1deb326610ef.go @@ -0,0 +1,37 @@ +package configurations +// The enablement status of secret scanning non provider patterns +type ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS +) + +func (i ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_secret_scanning_non_provider_patterns(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_secret_scanning_non_provider_patterns(values []ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_secret_scanning_non_provider_patterns) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_advanced_escaped_security.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_advanced_escaped_security.go new file mode 100644 index 00000000..1c115420 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_advanced_escaped_security.go @@ -0,0 +1,34 @@ +package configurations +// The enablement status of GitHub Advanced Security +type ConfigurationsPostRequestBody_advanced_security int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY ConfigurationsPostRequestBody_advanced_security = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY +) + +func (i ConfigurationsPostRequestBody_advanced_security) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseConfigurationsPostRequestBody_advanced_security(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_ADVANCED_SECURITY + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_advanced_security(values []ConfigurationsPostRequestBody_advanced_security) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_advanced_security) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_code_escaped_scanning_escaped_default_escaped_setup.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_code_escaped_scanning_escaped_default_escaped_setup.go new file mode 100644 index 00000000..0cb8d0b2 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_code_escaped_scanning_escaped_default_escaped_setup.go @@ -0,0 +1,37 @@ +package configurations +// The enablement status of code scanning default setup +type ConfigurationsPostRequestBody_code_scanning_default_setup int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP ConfigurationsPostRequestBody_code_scanning_default_setup = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP +) + +func (i ConfigurationsPostRequestBody_code_scanning_default_setup) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_code_scanning_default_setup(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_code_scanning_default_setup(values []ConfigurationsPostRequestBody_code_scanning_default_setup) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_code_scanning_default_setup) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependabot_escaped_alerts.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependabot_escaped_alerts.go new file mode 100644 index 00000000..106ff0b4 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependabot_escaped_alerts.go @@ -0,0 +1,37 @@ +package configurations +// The enablement status of Dependabot alerts +type ConfigurationsPostRequestBody_dependabot_alerts int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS ConfigurationsPostRequestBody_dependabot_alerts = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS +) + +func (i ConfigurationsPostRequestBody_dependabot_alerts) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_dependabot_alerts(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_ALERTS + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_dependabot_alerts(values []ConfigurationsPostRequestBody_dependabot_alerts) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_dependabot_alerts) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependabot_escaped_security_escaped_updates.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependabot_escaped_security_escaped_updates.go new file mode 100644 index 00000000..e1e3912f --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependabot_escaped_security_escaped_updates.go @@ -0,0 +1,37 @@ +package configurations +// The enablement status of Dependabot security updates +type ConfigurationsPostRequestBody_dependabot_security_updates int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES ConfigurationsPostRequestBody_dependabot_security_updates = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES +) + +func (i ConfigurationsPostRequestBody_dependabot_security_updates) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_dependabot_security_updates(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_dependabot_security_updates(values []ConfigurationsPostRequestBody_dependabot_security_updates) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_dependabot_security_updates) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependency_escaped_graph.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependency_escaped_graph.go new file mode 100644 index 00000000..589aa358 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependency_escaped_graph.go @@ -0,0 +1,37 @@ +package configurations +// The enablement status of Dependency Graph +type ConfigurationsPostRequestBody_dependency_graph int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH ConfigurationsPostRequestBody_dependency_graph = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH +) + +func (i ConfigurationsPostRequestBody_dependency_graph) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_dependency_graph(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_DEPENDENCY_GRAPH + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_dependency_graph(values []ConfigurationsPostRequestBody_dependency_graph) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_dependency_graph) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependency_escaped_graph_escaped_autosubmit_escaped_action.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependency_escaped_graph_escaped_autosubmit_escaped_action.go new file mode 100644 index 00000000..34e0a0f9 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_dependency_escaped_graph_escaped_autosubmit_escaped_action.go @@ -0,0 +1,37 @@ +package configurations +// 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 nil, nil + } + 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/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_enforcement.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_enforcement.go new file mode 100644 index 00000000..64613ae2 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_enforcement.go @@ -0,0 +1,34 @@ +package configurations +// The enforcement status for a security configuration +type ConfigurationsPostRequestBody_enforcement int + +const ( + ENFORCED_CONFIGURATIONSPOSTREQUESTBODY_ENFORCEMENT ConfigurationsPostRequestBody_enforcement = iota + UNENFORCED_CONFIGURATIONSPOSTREQUESTBODY_ENFORCEMENT +) + +func (i ConfigurationsPostRequestBody_enforcement) String() string { + return []string{"enforced", "unenforced"}[i] +} +func ParseConfigurationsPostRequestBody_enforcement(v string) (any, error) { + result := ENFORCED_CONFIGURATIONSPOSTREQUESTBODY_ENFORCEMENT + switch v { + case "enforced": + result = ENFORCED_CONFIGURATIONSPOSTREQUESTBODY_ENFORCEMENT + case "unenforced": + result = UNENFORCED_CONFIGURATIONSPOSTREQUESTBODY_ENFORCEMENT + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_enforcement(values []ConfigurationsPostRequestBody_enforcement) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_enforcement) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_private_escaped_vulnerability_escaped_reporting.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_private_escaped_vulnerability_escaped_reporting.go new file mode 100644 index 00000000..394ccdcc --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_private_escaped_vulnerability_escaped_reporting.go @@ -0,0 +1,37 @@ +package configurations +// The enablement status of private vulnerability reporting +type ConfigurationsPostRequestBody_private_vulnerability_reporting int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING ConfigurationsPostRequestBody_private_vulnerability_reporting = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING +) + +func (i ConfigurationsPostRequestBody_private_vulnerability_reporting) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_private_vulnerability_reporting(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_private_vulnerability_reporting(values []ConfigurationsPostRequestBody_private_vulnerability_reporting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_private_vulnerability_reporting) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning.go new file mode 100644 index 00000000..6b5f70e2 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning.go @@ -0,0 +1,37 @@ +package configurations +// The enablement status of secret scanning +type ConfigurationsPostRequestBody_secret_scanning int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING ConfigurationsPostRequestBody_secret_scanning = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING +) + +func (i ConfigurationsPostRequestBody_secret_scanning) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_secret_scanning(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_secret_scanning(values []ConfigurationsPostRequestBody_secret_scanning) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_secret_scanning) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning_escaped_push_escaped_protection.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning_escaped_push_escaped_protection.go new file mode 100644 index 00000000..7df1e6e9 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning_escaped_push_escaped_protection.go @@ -0,0 +1,37 @@ +package configurations +// The enablement status of secret scanning push protection +type ConfigurationsPostRequestBody_secret_scanning_push_protection int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION ConfigurationsPostRequestBody_secret_scanning_push_protection = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION +) + +func (i ConfigurationsPostRequestBody_secret_scanning_push_protection) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_secret_scanning_push_protection(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_secret_scanning_push_protection(values []ConfigurationsPostRequestBody_secret_scanning_push_protection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_secret_scanning_push_protection) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning_escaped_validity_escaped_checks.go b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning_escaped_validity_escaped_checks.go new file mode 100644 index 00000000..4200eeaf --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/configurations_post_request_body_escaped_secret_escaped_scanning_escaped_validity_escaped_checks.go @@ -0,0 +1,37 @@ +package configurations +// The enablement status of secret scanning validity checks +type ConfigurationsPostRequestBody_secret_scanning_validity_checks int + +const ( + ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS ConfigurationsPostRequestBody_secret_scanning_validity_checks = iota + DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS +) + +func (i ConfigurationsPostRequestBody_secret_scanning_validity_checks) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseConfigurationsPostRequestBody_secret_scanning_validity_checks(v string) (any, error) { + result := ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + switch v { + case "enabled": + result = ENABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + case "disabled": + result = DISABLED_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + case "not_set": + result = NOT_SET_CONFIGURATIONSPOSTREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + default: + return nil, nil + } + return &result, nil +} +func SerializeConfigurationsPostRequestBody_secret_scanning_validity_checks(values []ConfigurationsPostRequestBody_secret_scanning_validity_checks) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ConfigurationsPostRequestBody_secret_scanning_validity_checks) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/2dd781707d3b0cc4f1cd9f16046e55b00ace3da6cc3b9dc11b819837b65bf7f6.go b/pkg/github/enterprises/item/codesecurity/configurations/item/2dd781707d3b0cc4f1cd9f16046e55b00ace3da6cc3b9dc11b819837b65bf7f6.go new file mode 100644 index 00000000..947d1278 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/2dd781707d3b0cc4f1cd9f16046e55b00ace3da6cc3b9dc11b819837b65bf7f6.go @@ -0,0 +1,37 @@ +package item +// The enablement status of secret scanning non-provider patterns +type WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS +) + +func (i WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_NON_PROVIDER_PATTERNS + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns(values []WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_secret_scanning_non_provider_patterns) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/6ebbeed57f232a4eb995f80331a623fda6e62b3c67b501f55bf37eb9639d8e89.go b/pkg/github/enterprises/item/codesecurity/configurations/item/6ebbeed57f232a4eb995f80331a623fda6e62b3c67b501f55bf37eb9639d8e89.go new file mode 100644 index 00000000..b74a8f10 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/6ebbeed57f232a4eb995f80331a623fda6e62b3c67b501f55bf37eb9639d8e89.go @@ -0,0 +1,37 @@ +package item +// 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 nil, nil + } + 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/enterprises/item/codesecurity/configurations/item/9b6a045cea50d4d3b80c85099db3f714b827767b9b2496c2c2686b6d8ef3755f.go b/pkg/github/enterprises/item/codesecurity/configurations/item/9b6a045cea50d4d3b80c85099db3f714b827767b9b2496c2c2686b6d8ef3755f.go new file mode 100644 index 00000000..bb1ada6d --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/9b6a045cea50d4d3b80c85099db3f714b827767b9b2496c2c2686b6d8ef3755f.go @@ -0,0 +1,37 @@ +package item +// The enablement status of secret scanning validity checks +type WithConfiguration_PatchRequestBody_secret_scanning_validity_checks int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS WithConfiguration_PatchRequestBody_secret_scanning_validity_checks = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS +) + +func (i WithConfiguration_PatchRequestBody_secret_scanning_validity_checks) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_secret_scanning_validity_checks(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_VALIDITY_CHECKS + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_secret_scanning_validity_checks(values []WithConfiguration_PatchRequestBody_secret_scanning_validity_checks) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_secret_scanning_validity_checks) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/attach/attach_post_request_body_escaped_scope.go b/pkg/github/enterprises/item/codesecurity/configurations/item/attach/attach_post_request_body_escaped_scope.go new file mode 100644 index 00000000..74549665 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/attach/attach_post_request_body_escaped_scope.go @@ -0,0 +1,34 @@ +package attach +// The type of repositories to attach the configuration to. `selected` means the configuration will be attached to only the repositories specified by `selected_repository_ids` +type AttachPostRequestBody_scope int + +const ( + ALL_ATTACHPOSTREQUESTBODY_SCOPE AttachPostRequestBody_scope = iota + ALL_WITHOUT_CONFIGURATIONS_ATTACHPOSTREQUESTBODY_SCOPE +) + +func (i AttachPostRequestBody_scope) String() string { + return []string{"all", "all_without_configurations"}[i] +} +func ParseAttachPostRequestBody_scope(v string) (any, error) { + result := ALL_ATTACHPOSTREQUESTBODY_SCOPE + switch v { + case "all": + result = ALL_ATTACHPOSTREQUESTBODY_SCOPE + case "all_without_configurations": + result = ALL_WITHOUT_CONFIGURATIONS_ATTACHPOSTREQUESTBODY_SCOPE + default: + return nil, nil + } + return &result, nil +} +func SerializeAttachPostRequestBody_scope(values []AttachPostRequestBody_scope) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AttachPostRequestBody_scope) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/defaults/defaults_put_request_body_escaped_default_escaped_for_escaped_new_escaped_repos.go b/pkg/github/enterprises/item/codesecurity/configurations/item/defaults/defaults_put_request_body_escaped_default_escaped_for_escaped_new_escaped_repos.go new file mode 100644 index 00000000..24e41f5e --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/defaults/defaults_put_request_body_escaped_default_escaped_for_escaped_new_escaped_repos.go @@ -0,0 +1,40 @@ +package defaults +// Specify which types of repository this security configuration should be applied to by default. +type DefaultsPutRequestBody_default_for_new_repos int + +const ( + ALL_DEFAULTSPUTREQUESTBODY_DEFAULT_FOR_NEW_REPOS DefaultsPutRequestBody_default_for_new_repos = iota + NONE_DEFAULTSPUTREQUESTBODY_DEFAULT_FOR_NEW_REPOS + PRIVATE_AND_INTERNAL_DEFAULTSPUTREQUESTBODY_DEFAULT_FOR_NEW_REPOS + PUBLIC_DEFAULTSPUTREQUESTBODY_DEFAULT_FOR_NEW_REPOS +) + +func (i DefaultsPutRequestBody_default_for_new_repos) String() string { + return []string{"all", "none", "private_and_internal", "public"}[i] +} +func ParseDefaultsPutRequestBody_default_for_new_repos(v string) (any, error) { + result := ALL_DEFAULTSPUTREQUESTBODY_DEFAULT_FOR_NEW_REPOS + switch v { + case "all": + result = ALL_DEFAULTSPUTREQUESTBODY_DEFAULT_FOR_NEW_REPOS + case "none": + result = NONE_DEFAULTSPUTREQUESTBODY_DEFAULT_FOR_NEW_REPOS + case "private_and_internal": + result = PRIVATE_AND_INTERNAL_DEFAULTSPUTREQUESTBODY_DEFAULT_FOR_NEW_REPOS + case "public": + result = PUBLIC_DEFAULTSPUTREQUESTBODY_DEFAULT_FOR_NEW_REPOS + default: + return nil, nil + } + return &result, nil +} +func SerializeDefaultsPutRequestBody_default_for_new_repos(values []DefaultsPutRequestBody_default_for_new_repos) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DefaultsPutRequestBody_default_for_new_repos) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/defaults/defaults_put_response_escaped_default_escaped_for_escaped_new_escaped_repos.go b/pkg/github/enterprises/item/codesecurity/configurations/item/defaults/defaults_put_response_escaped_default_escaped_for_escaped_new_escaped_repos.go new file mode 100644 index 00000000..22e7720f --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/defaults/defaults_put_response_escaped_default_escaped_for_escaped_new_escaped_repos.go @@ -0,0 +1,40 @@ +package defaults +// Specifies which types of repository this security configuration is applied to by default. +type DefaultsPutResponse_default_for_new_repos int + +const ( + ALL_DEFAULTSPUTRESPONSE_DEFAULT_FOR_NEW_REPOS DefaultsPutResponse_default_for_new_repos = iota + NONE_DEFAULTSPUTRESPONSE_DEFAULT_FOR_NEW_REPOS + PRIVATE_AND_INTERNAL_DEFAULTSPUTRESPONSE_DEFAULT_FOR_NEW_REPOS + PUBLIC_DEFAULTSPUTRESPONSE_DEFAULT_FOR_NEW_REPOS +) + +func (i DefaultsPutResponse_default_for_new_repos) String() string { + return []string{"all", "none", "private_and_internal", "public"}[i] +} +func ParseDefaultsPutResponse_default_for_new_repos(v string) (any, error) { + result := ALL_DEFAULTSPUTRESPONSE_DEFAULT_FOR_NEW_REPOS + switch v { + case "all": + result = ALL_DEFAULTSPUTRESPONSE_DEFAULT_FOR_NEW_REPOS + case "none": + result = NONE_DEFAULTSPUTRESPONSE_DEFAULT_FOR_NEW_REPOS + case "private_and_internal": + result = PRIVATE_AND_INTERNAL_DEFAULTSPUTRESPONSE_DEFAULT_FOR_NEW_REPOS + case "public": + result = PUBLIC_DEFAULTSPUTRESPONSE_DEFAULT_FOR_NEW_REPOS + default: + return nil, nil + } + return &result, nil +} +func SerializeDefaultsPutResponse_default_for_new_repos(values []DefaultsPutResponse_default_for_new_repos) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DefaultsPutResponse_default_for_new_repos) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/e5d0227cc898daa954d494c8a4d4a65b0e38b27a546d2a4303db86085c4c4129.go b/pkg/github/enterprises/item/codesecurity/configurations/item/e5d0227cc898daa954d494c8a4d4a65b0e38b27a546d2a4303db86085c4c4129.go new file mode 100644 index 00000000..ac13f2c4 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/e5d0227cc898daa954d494c8a4d4a65b0e38b27a546d2a4303db86085c4c4129.go @@ -0,0 +1,37 @@ +package item +// The enablement status of secret scanning push protection +type WithConfiguration_PatchRequestBody_secret_scanning_push_protection int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION WithConfiguration_PatchRequestBody_secret_scanning_push_protection = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION +) + +func (i WithConfiguration_PatchRequestBody_secret_scanning_push_protection) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_secret_scanning_push_protection(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING_PUSH_PROTECTION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_secret_scanning_push_protection(values []WithConfiguration_PatchRequestBody_secret_scanning_push_protection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_secret_scanning_push_protection) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/e5fc1a3db286a5c7a2fd8cee0dd10d21cd84b3cb7b6761b14c5473867a116ec1.go b/pkg/github/enterprises/item/codesecurity/configurations/item/e5fc1a3db286a5c7a2fd8cee0dd10d21cd84b3cb7b6761b14c5473867a116ec1.go new file mode 100644 index 00000000..da6208ad --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/e5fc1a3db286a5c7a2fd8cee0dd10d21cd84b3cb7b6761b14c5473867a116ec1.go @@ -0,0 +1,37 @@ +package item +// The enablement status of private vulnerability reporting +type WithConfiguration_PatchRequestBody_private_vulnerability_reporting int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING WithConfiguration_PatchRequestBody_private_vulnerability_reporting = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING +) + +func (i WithConfiguration_PatchRequestBody_private_vulnerability_reporting) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_private_vulnerability_reporting(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_PRIVATE_VULNERABILITY_REPORTING + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_private_vulnerability_reporting(values []WithConfiguration_PatchRequestBody_private_vulnerability_reporting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_private_vulnerability_reporting) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/f8d7dd54ba95aae66631abec2d4656064a4037c7bd83a17eb2c78011484ce063.go b/pkg/github/enterprises/item/codesecurity/configurations/item/f8d7dd54ba95aae66631abec2d4656064a4037c7bd83a17eb2c78011484ce063.go new file mode 100644 index 00000000..6888c608 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/f8d7dd54ba95aae66631abec2d4656064a4037c7bd83a17eb2c78011484ce063.go @@ -0,0 +1,37 @@ +package item +// The enablement status of code scanning default setup +type WithConfiguration_PatchRequestBody_code_scanning_default_setup int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP WithConfiguration_PatchRequestBody_code_scanning_default_setup = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP +) + +func (i WithConfiguration_PatchRequestBody_code_scanning_default_setup) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_code_scanning_default_setup(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_CODE_SCANNING_DEFAULT_SETUP + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_code_scanning_default_setup(values []WithConfiguration_PatchRequestBody_code_scanning_default_setup) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_code_scanning_default_setup) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_advanced_escaped_security.go b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_advanced_escaped_security.go new file mode 100644 index 00000000..c6bb6882 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_advanced_escaped_security.go @@ -0,0 +1,34 @@ +package item +// The enablement status of GitHub Advanced Security. Must be set to enabled if you want to enable any GHAS settings. +type WithConfiguration_PatchRequestBody_advanced_security int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_ADVANCED_SECURITY WithConfiguration_PatchRequestBody_advanced_security = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_ADVANCED_SECURITY +) + +func (i WithConfiguration_PatchRequestBody_advanced_security) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseWithConfiguration_PatchRequestBody_advanced_security(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_ADVANCED_SECURITY + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_ADVANCED_SECURITY + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_ADVANCED_SECURITY + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_advanced_security(values []WithConfiguration_PatchRequestBody_advanced_security) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_advanced_security) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependabot_escaped_alerts.go b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependabot_escaped_alerts.go new file mode 100644 index 00000000..f68103a6 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependabot_escaped_alerts.go @@ -0,0 +1,37 @@ +package item +// The enablement status of Dependabot alerts +type WithConfiguration_PatchRequestBody_dependabot_alerts int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_ALERTS WithConfiguration_PatchRequestBody_dependabot_alerts = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_ALERTS + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_ALERTS +) + +func (i WithConfiguration_PatchRequestBody_dependabot_alerts) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_dependabot_alerts(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_ALERTS + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_ALERTS + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_ALERTS + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_ALERTS + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_dependabot_alerts(values []WithConfiguration_PatchRequestBody_dependabot_alerts) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_dependabot_alerts) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependabot_escaped_security_escaped_updates.go b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependabot_escaped_security_escaped_updates.go new file mode 100644 index 00000000..f5b58a53 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependabot_escaped_security_escaped_updates.go @@ -0,0 +1,37 @@ +package item +// The enablement status of Dependabot security updates +type WithConfiguration_PatchRequestBody_dependabot_security_updates int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_SECURITY_UPDATES WithConfiguration_PatchRequestBody_dependabot_security_updates = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_SECURITY_UPDATES +) + +func (i WithConfiguration_PatchRequestBody_dependabot_security_updates) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_dependabot_security_updates(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDABOT_SECURITY_UPDATES + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_dependabot_security_updates(values []WithConfiguration_PatchRequestBody_dependabot_security_updates) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_dependabot_security_updates) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependency_escaped_graph.go b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependency_escaped_graph.go new file mode 100644 index 00000000..9742ca37 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_dependency_escaped_graph.go @@ -0,0 +1,37 @@ +package item +// The enablement status of Dependency Graph +type WithConfiguration_PatchRequestBody_dependency_graph int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH WithConfiguration_PatchRequestBody_dependency_graph = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH +) + +func (i WithConfiguration_PatchRequestBody_dependency_graph) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_dependency_graph(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_DEPENDENCY_GRAPH + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_dependency_graph(values []WithConfiguration_PatchRequestBody_dependency_graph) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_dependency_graph) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_enforcement.go b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_enforcement.go new file mode 100644 index 00000000..d366385c --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_enforcement.go @@ -0,0 +1,34 @@ +package item +// The enforcement status for a security configuration +type WithConfiguration_PatchRequestBody_enforcement int + +const ( + ENFORCED_WITHCONFIGURATION_PATCHREQUESTBODY_ENFORCEMENT WithConfiguration_PatchRequestBody_enforcement = iota + UNENFORCED_WITHCONFIGURATION_PATCHREQUESTBODY_ENFORCEMENT +) + +func (i WithConfiguration_PatchRequestBody_enforcement) String() string { + return []string{"enforced", "unenforced"}[i] +} +func ParseWithConfiguration_PatchRequestBody_enforcement(v string) (any, error) { + result := ENFORCED_WITHCONFIGURATION_PATCHREQUESTBODY_ENFORCEMENT + switch v { + case "enforced": + result = ENFORCED_WITHCONFIGURATION_PATCHREQUESTBODY_ENFORCEMENT + case "unenforced": + result = UNENFORCED_WITHCONFIGURATION_PATCHREQUESTBODY_ENFORCEMENT + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_enforcement(values []WithConfiguration_PatchRequestBody_enforcement) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_enforcement) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_secret_escaped_scanning.go b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_secret_escaped_scanning.go new file mode 100644 index 00000000..04c20139 --- /dev/null +++ b/pkg/github/enterprises/item/codesecurity/configurations/item/with_configuration_escaped_patch_request_body_escaped_secret_escaped_scanning.go @@ -0,0 +1,37 @@ +package item +// The enablement status of secret scanning +type WithConfiguration_PatchRequestBody_secret_scanning int + +const ( + ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING WithConfiguration_PatchRequestBody_secret_scanning = iota + DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING + NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING +) + +func (i WithConfiguration_PatchRequestBody_secret_scanning) String() string { + return []string{"enabled", "disabled", "not_set"}[i] +} +func ParseWithConfiguration_PatchRequestBody_secret_scanning(v string) (any, error) { + result := ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING + switch v { + case "enabled": + result = ENABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING + case "disabled": + result = DISABLED_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING + case "not_set": + result = NOT_SET_WITHCONFIGURATION_PATCHREQUESTBODY_SECRET_SCANNING + default: + return nil, nil + } + return &result, nil +} +func SerializeWithConfiguration_PatchRequestBody_secret_scanning(values []WithConfiguration_PatchRequestBody_secret_scanning) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithConfiguration_PatchRequestBody_secret_scanning) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item_code_security_configurations_defaults_request_builder.go b/pkg/github/enterprises/item_code_security_configurations_defaults_request_builder.go new file mode 100644 index 00000000..da63ff57 --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_defaults_request_builder.go @@ -0,0 +1,60 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsDefaultsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\defaults +type ItemCodeSecurityConfigurationsDefaultsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodeSecurityConfigurationsDefaultsRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsDefaultsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsDefaultsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsDefaultsRequestBuilder) { + m := &ItemCodeSecurityConfigurationsDefaultsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/defaults", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsDefaultsRequestBuilder instantiates a new ItemCodeSecurityConfigurationsDefaultsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsDefaultsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsDefaultsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsDefaultsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the default code security configurations for an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +// returns a []CodeSecurityDefaultConfigurationsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise +func (m *ItemCodeSecurityConfigurationsDefaultsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityDefaultConfigurationsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityDefaultConfigurationsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityDefaultConfigurationsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityDefaultConfigurationsable) + } + } + return val, nil +} +// ToGetRequestInformation lists the default code security configurations for an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsDefaultsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsDefaultsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsDefaultsRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsDefaultsRequestBuilder) { + return NewItemCodeSecurityConfigurationsDefaultsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_code_security_configurations_item_attach_post_request_body.go b/pkg/github/enterprises/item_code_security_configurations_item_attach_post_request_body.go new file mode 100644 index 00000000..73a907e0 --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_item_attach_post_request_body.go @@ -0,0 +1,32 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodeSecurityConfigurationsItemAttachPostRequestBody struct { +} +// NewItemCodeSecurityConfigurationsItemAttachPostRequestBody instantiates a new ItemCodeSecurityConfigurationsItemAttachPostRequestBody and sets the default values. +func NewItemCodeSecurityConfigurationsItemAttachPostRequestBody()(*ItemCodeSecurityConfigurationsItemAttachPostRequestBody) { + m := &ItemCodeSecurityConfigurationsItemAttachPostRequestBody{ + } + return m +} +// CreateItemCodeSecurityConfigurationsItemAttachPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemAttachPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemAttachPostRequestBody(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemAttachPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemAttachPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type ItemCodeSecurityConfigurationsItemAttachPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/enterprises/item_code_security_configurations_item_attach_post_response.go b/pkg/github/enterprises/item_code_security_configurations_item_attach_post_response.go new file mode 100644 index 00000000..310addf4 --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_item_attach_post_response.go @@ -0,0 +1,51 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodeSecurityConfigurationsItemAttachPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemCodeSecurityConfigurationsItemAttachPostResponse instantiates a new ItemCodeSecurityConfigurationsItemAttachPostResponse and sets the default values. +func NewItemCodeSecurityConfigurationsItemAttachPostResponse()(*ItemCodeSecurityConfigurationsItemAttachPostResponse) { + m := &ItemCodeSecurityConfigurationsItemAttachPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodeSecurityConfigurationsItemAttachPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemAttachPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemAttachPostResponse(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemCodeSecurityConfigurationsItemAttachPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemAttachPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemAttachPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemCodeSecurityConfigurationsItemAttachPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemCodeSecurityConfigurationsItemAttachPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/enterprises/item_code_security_configurations_item_attach_request_builder.go b/pkg/github/enterprises/item_code_security_configurations_item_attach_request_builder.go new file mode 100644 index 00000000..c23a1c1f --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_item_attach_request_builder.go @@ -0,0 +1,69 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsItemAttachRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\{configuration_id}\attach +type ItemCodeSecurityConfigurationsItemAttachRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodeSecurityConfigurationsItemAttachRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsItemAttachRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemAttachRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemAttachRequestBuilder) { + m := &ItemCodeSecurityConfigurationsItemAttachRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsItemAttachRequestBuilder instantiates a new ItemCodeSecurityConfigurationsItemAttachRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemAttachRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemAttachRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsItemAttachRequestBuilderInternal(urlParams, requestAdapter) +} +// Post attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a ItemCodeSecurityConfigurationsItemAttachPostResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories +func (m *ItemCodeSecurityConfigurationsItemAttachRequestBuilder) Post(ctx context.Context, body ItemCodeSecurityConfigurationsItemAttachPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCodeSecurityConfigurationsItemAttachPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCodeSecurityConfigurationsItemAttachPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCodeSecurityConfigurationsItemAttachPostResponseable), nil +} +// ToPostRequestInformation attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsItemAttachRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCodeSecurityConfigurationsItemAttachPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsItemAttachRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsItemAttachRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsItemAttachRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemAttachRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_code_security_configurations_item_defaults_put_request_body.go b/pkg/github/enterprises/item_code_security_configurations_item_defaults_put_request_body.go new file mode 100644 index 00000000..534e1a3c --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_item_defaults_put_request_body.go @@ -0,0 +1,51 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemCodeSecurityConfigurationsItemDefaultsPutRequestBody instantiates a new ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody and sets the default values. +func NewItemCodeSecurityConfigurationsItemDefaultsPutRequestBody()(*ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) { + m := &ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemDefaultsPutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + return res +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/enterprises/item_code_security_configurations_item_defaults_put_response.go b/pkg/github/enterprises/item_code_security_configurations_item_defaults_put_response.go new file mode 100644 index 00000000..aad36d0d --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_item_defaults_put_response.go @@ -0,0 +1,81 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemCodeSecurityConfigurationsItemDefaultsPutResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A code security configuration + configuration i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable +} +// NewItemCodeSecurityConfigurationsItemDefaultsPutResponse instantiates a new ItemCodeSecurityConfigurationsItemDefaultsPutResponse and sets the default values. +func NewItemCodeSecurityConfigurationsItemDefaultsPutResponse()(*ItemCodeSecurityConfigurationsItemDefaultsPutResponse) { + m := &ItemCodeSecurityConfigurationsItemDefaultsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCodeSecurityConfigurationsItemDefaultsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemDefaultsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemDefaultsPutResponse(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfiguration gets the configuration property value. A code security configuration +// returns a CodeSecurityConfigurationable when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) GetConfiguration()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable) { + return m.configuration +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["configuration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfiguration(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("configuration", m.GetConfiguration()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfiguration sets the configuration property value. A code security configuration +func (m *ItemCodeSecurityConfigurationsItemDefaultsPutResponse) SetConfiguration(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable)() { + m.configuration = value +} +type ItemCodeSecurityConfigurationsItemDefaultsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfiguration()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable) + SetConfiguration(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable)() +} diff --git a/pkg/github/enterprises/item_code_security_configurations_item_defaults_request_builder.go b/pkg/github/enterprises/item_code_security_configurations_item_defaults_request_builder.go new file mode 100644 index 00000000..648b3a3d --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_item_defaults_request_builder.go @@ -0,0 +1,67 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\{configuration_id}\defaults +type ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) { + m := &ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilder instantiates a new ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilderInternal(urlParams, requestAdapter) +} +// Put sets a code security configuration as a default to be applied to new repositories in your enterprise.This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a ItemCodeSecurityConfigurationsItemDefaultsPutResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise +func (m *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) Put(ctx context.Context, body ItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCodeSecurityConfigurationsItemDefaultsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCodeSecurityConfigurationsItemDefaultsPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCodeSecurityConfigurationsItemDefaultsPutResponseable), nil +} +// ToPutRequestInformation sets a code security configuration as a default to be applied to new repositories in your enterprise.This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemCodeSecurityConfigurationsItemDefaultsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_code_security_configurations_item_repositories_request_builder.go b/pkg/github/enterprises/item_code_security_configurations_item_repositories_request_builder.go new file mode 100644 index 00000000..49287a72 --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_item_repositories_request_builder.go @@ -0,0 +1,77 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\{configuration_id}\repositories +type ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderGetQueryParameters lists the repositories associated with an enterprise code security configuration in an organization.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +type ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned.Can be: `all`, `attached`, `attaching`, `removed`, `enforced`, `failed`, `updating`, `removed_by_enterprise` + Status *string `uriparametername:"status"` +} +// NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) { + m := &ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories{?after*,before*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder instantiates a new ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the repositories associated with an enterprise code security configuration in an organization.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +// returns a []CodeSecurityConfigurationRepositoriesable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration +func (m *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationRepositoriesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationRepositoriesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationRepositoriesable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationRepositoriesable) + } + } + return val, nil +} +// ToGetRequestInformation lists the repositories associated with an enterprise code security configuration in an organization.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_code_security_configurations_item_with_configuration_escaped_patch_request_body.go b/pkg/github/enterprises/item_code_security_configurations_item_with_configuration_escaped_patch_request_body.go new file mode 100644 index 00000000..fe457a77 --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_item_with_configuration_escaped_patch_request_body.go @@ -0,0 +1,149 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody struct { + // Feature options for code scanning default setup + code_scanning_default_setup_options i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable + // 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 across the enterprise. + name *string +} +// NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody instantiates a new ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody and sets the default values. +func NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody()(*ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) { + m := &ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody{ + } + return m +} +// CreateItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody(), nil +} +// GetCodeScanningDefaultSetupOptions gets the code_scanning_default_setup_options property value. Feature options for code scanning default setup +// returns a CodeScanningDefaultSetupOptionsable when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) GetCodeScanningDefaultSetupOptions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable) { + return m.code_scanning_default_setup_options +} +// 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) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code_scanning_default_setup_options"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningDefaultSetupOptionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningDefaultSetupOptions(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable)) + } + return nil + } + 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 { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the code security configuration. Must be unique across the enterprise. +// returns a *string when successful +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("code_scanning_default_setup_options", m.GetCodeScanningDefaultSetupOptions()) + 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 { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + return nil +} +// SetCodeScanningDefaultSetupOptions sets the code_scanning_default_setup_options property value. Feature options for code scanning default setup +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) SetCodeScanningDefaultSetupOptions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable)() { + m.code_scanning_default_setup_options = value +} +// 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 +} +// SetName sets the name property value. The name of the code security configuration. Must be unique across the enterprise. +func (m *ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody) SetName(value *string)() { + m.name = value +} +type ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodeScanningDefaultSetupOptions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable) + GetDependencyGraphAutosubmitActionOptions()(ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable) + GetDescription()(*string) + GetName()(*string) + SetCodeScanningDefaultSetupOptions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable)() + SetDependencyGraphAutosubmitActionOptions(value ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBody_dependency_graph_autosubmit_action_optionsable)() + SetDescription(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/enterprises/item_code_security_configurations_post_request_body.go b/pkg/github/enterprises/item_code_security_configurations_post_request_body.go new file mode 100644 index 00000000..92439d69 --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_post_request_body.go @@ -0,0 +1,149 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemCodeSecurityConfigurationsPostRequestBody struct { + // Feature options for code scanning default setup + code_scanning_default_setup_options i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable + // 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 enterprise. + name *string +} +// NewItemCodeSecurityConfigurationsPostRequestBody instantiates a new ItemCodeSecurityConfigurationsPostRequestBody and sets the default values. +func NewItemCodeSecurityConfigurationsPostRequestBody()(*ItemCodeSecurityConfigurationsPostRequestBody) { + m := &ItemCodeSecurityConfigurationsPostRequestBody{ + } + return m +} +// CreateItemCodeSecurityConfigurationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCodeSecurityConfigurationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCodeSecurityConfigurationsPostRequestBody(), nil +} +// GetCodeScanningDefaultSetupOptions gets the code_scanning_default_setup_options property value. Feature options for code scanning default setup +// returns a CodeScanningDefaultSetupOptionsable when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetCodeScanningDefaultSetupOptions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable) { + return m.code_scanning_default_setup_options +} +// 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) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code_scanning_default_setup_options"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningDefaultSetupOptionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningDefaultSetupOptions(val.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable)) + } + return nil + } + 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 { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the code security configuration. Must be unique within the enterprise. +// returns a *string when successful +func (m *ItemCodeSecurityConfigurationsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemCodeSecurityConfigurationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("code_scanning_default_setup_options", m.GetCodeScanningDefaultSetupOptions()) + 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 { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + return nil +} +// SetCodeScanningDefaultSetupOptions sets the code_scanning_default_setup_options property value. Feature options for code scanning default setup +func (m *ItemCodeSecurityConfigurationsPostRequestBody) SetCodeScanningDefaultSetupOptions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable)() { + m.code_scanning_default_setup_options = value +} +// 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 +} +// SetName sets the name property value. The name of the code security configuration. Must be unique within the enterprise. +func (m *ItemCodeSecurityConfigurationsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemCodeSecurityConfigurationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodeScanningDefaultSetupOptions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable) + GetDependencyGraphAutosubmitActionOptions()(ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable) + GetDescription()(*string) + GetName()(*string) + SetCodeScanningDefaultSetupOptions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningDefaultSetupOptionsable)() + SetDependencyGraphAutosubmitActionOptions(value ItemCodeSecurityConfigurationsPostRequestBody_dependency_graph_autosubmit_action_optionsable)() + SetDescription(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/enterprises/item_code_security_configurations_request_builder.go b/pkg/github/enterprises/item_code_security_configurations_request_builder.go new file mode 100644 index 00000000..bf9cd17d --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_request_builder.go @@ -0,0 +1,130 @@ +package enterprises + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations +type ItemCodeSecurityConfigurationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodeSecurityConfigurationsRequestBuilderGetQueryParameters lists all code security configurations available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +type ItemCodeSecurityConfigurationsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByConfiguration_id gets an item from the github.com/octokit/go-sdk/pkg/github.enterprises.item.codeSecurity.configurations.item collection +// returns a *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) ByConfiguration_id(configuration_id int32)(*ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["configuration_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(configuration_id), 10) + return NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodeSecurityConfigurationsRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsRequestBuilder) { + m := &ItemCodeSecurityConfigurationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations{?after*,before*,per_page*}", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsRequestBuilder instantiates a new ItemCodeSecurityConfigurationsRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Defaults the defaults property +// returns a *ItemCodeSecurityConfigurationsDefaultsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) Defaults()(*ItemCodeSecurityConfigurationsDefaultsRequestBuilder) { + return NewItemCodeSecurityConfigurationsDefaultsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get lists all code security configurations available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +// returns a []CodeSecurityConfigurationable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise +func (m *ItemCodeSecurityConfigurationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeSecurityConfigurationsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable) + } + } + return val, nil +} +// Post creates a code security configuration in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a CodeSecurityConfigurationable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise +func (m *ItemCodeSecurityConfigurationsRequestBuilder) Post(ctx context.Context, body ItemCodeSecurityConfigurationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable), nil +} +// ToGetRequestInformation lists all code security configurations available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeSecurityConfigurationsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates a code security configuration in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCodeSecurityConfigurationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsRequestBuilder) { + return NewItemCodeSecurityConfigurationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_code_security_configurations_with_configuration_escaped_item_request_builder.go b/pkg/github/enterprises/item_code_security_configurations_with_configuration_escaped_item_request_builder.go new file mode 100644 index 00000000..cc62cd37 --- /dev/null +++ b/pkg/github/enterprises/item_code_security_configurations_with_configuration_escaped_item_request_builder.go @@ -0,0 +1,150 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code-security\configurations\{configuration_id} +type ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Attach the attach property +// returns a *ItemCodeSecurityConfigurationsItemAttachRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Attach()(*ItemCodeSecurityConfigurationsItemAttachRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemAttachRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilderInternal instantiates a new ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) { + m := &ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security/configurations/{configuration_id}", pathParameters), + } + return m +} +// NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder instantiates a new ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder and sets the default values. +func NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Defaults the defaults property +// returns a *ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Defaults()(*ItemCodeSecurityConfigurationsItemDefaultsRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemDefaultsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete deletes a code security configuration from an enterprise.Repositories attached to the configuration will retain their settings but will no longer be associated withthe configuration.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a code security configuration available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +// returns a CodeSecurityConfigurationable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable), nil +} +// Patch updates a code security configuration in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a CodeSecurityConfigurationable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Patch(ctx context.Context, body ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "409": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeSecurityConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeSecurityConfigurationable), nil +} +// Repositories the repositories property +// returns a *ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) Repositories()(*ItemCodeSecurityConfigurationsItemRepositoriesRequestBuilder) { + return NewItemCodeSecurityConfigurationsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a code security configuration from an enterprise.Repositories attached to the configuration will retain their settings but will no longer be associated withthe configuration.The authenticated user must be an administrator for the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json, application/scim+json") + return requestInfo, nil +} +// ToGetRequestInformation gets a code security configuration available in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation updates a code security configuration in an enterprise.The authenticated user must be an administrator of the enterprise in order to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemCodeSecurityConfigurationsItemWithConfiguration_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder when successful +func (m *ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder) { + return NewItemCodeSecurityConfigurationsWithConfiguration_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_code_security_request_builder.go b/pkg/github/enterprises/item_code_security_request_builder.go new file mode 100644 index 00000000..5a8ecae0 --- /dev/null +++ b/pkg/github/enterprises/item_code_security_request_builder.go @@ -0,0 +1,28 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCodeSecurityRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code-security +type ItemCodeSecurityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Configurations the configurations property +// returns a *ItemCodeSecurityConfigurationsRequestBuilder when successful +func (m *ItemCodeSecurityRequestBuilder) Configurations()(*ItemCodeSecurityConfigurationsRequestBuilder) { + return NewItemCodeSecurityConfigurationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodeSecurityRequestBuilderInternal instantiates a new ItemCodeSecurityRequestBuilder and sets the default values. +func NewItemCodeSecurityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityRequestBuilder) { + m := &ItemCodeSecurityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-security", pathParameters), + } + return m +} +// NewItemCodeSecurityRequestBuilder instantiates a new ItemCodeSecurityRequestBuilder and sets the default values. +func NewItemCodeSecurityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeSecurityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeSecurityRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/enterprises/item_copilot_billing_request_builder.go b/pkg/github/enterprises/item_copilot_billing_request_builder.go deleted file mode 100644 index 3d4ee8be..00000000 --- a/pkg/github/enterprises/item_copilot_billing_request_builder.go +++ /dev/null @@ -1,28 +0,0 @@ -package enterprises - -import ( - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" -) - -// ItemCopilotBillingRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot\billing -type ItemCopilotBillingRequestBuilder struct { - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder -} -// NewItemCopilotBillingRequestBuilderInternal instantiates a new ItemCopilotBillingRequestBuilder and sets the default values. -func NewItemCopilotBillingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingRequestBuilder) { - m := &ItemCopilotBillingRequestBuilder{ - BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/billing", pathParameters), - } - return m -} -// NewItemCopilotBillingRequestBuilder instantiates a new ItemCopilotBillingRequestBuilder and sets the default values. -func NewItemCopilotBillingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingRequestBuilder) { - urlParams := make(map[string]string) - urlParams["request-raw-url"] = rawUrl - return NewItemCopilotBillingRequestBuilderInternal(urlParams, requestAdapter) -} -// Seats the seats property -// returns a *ItemCopilotBillingSeatsRequestBuilder when successful -func (m *ItemCopilotBillingRequestBuilder) Seats()(*ItemCopilotBillingSeatsRequestBuilder) { - return NewItemCopilotBillingSeatsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) -} diff --git a/pkg/github/enterprises/item_copilot_billing_seats_get_response.go b/pkg/github/enterprises/item_copilot_billing_seats_get_response.go deleted file mode 100644 index 3e6c50e4..00000000 --- a/pkg/github/enterprises/item_copilot_billing_seats_get_response.go +++ /dev/null @@ -1,122 +0,0 @@ -package enterprises - -import ( - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" - i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" -) - -type ItemCopilotBillingSeatsGetResponse struct { - // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - additionalData map[string]any - // The seats property - seats []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable - // The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. - total_seats *int32 -} -// NewItemCopilotBillingSeatsGetResponse instantiates a new ItemCopilotBillingSeatsGetResponse and sets the default values. -func NewItemCopilotBillingSeatsGetResponse()(*ItemCopilotBillingSeatsGetResponse) { - m := &ItemCopilotBillingSeatsGetResponse{ - } - m.SetAdditionalData(make(map[string]any)) - return m -} -// CreateItemCopilotBillingSeatsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value -// returns a Parsable when successful -func CreateItemCopilotBillingSeatsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { - return NewItemCopilotBillingSeatsGetResponse(), nil -} -// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -// returns a map[string]any when successful -func (m *ItemCopilotBillingSeatsGetResponse) GetAdditionalData()(map[string]any) { - return m.additionalData -} -// GetFieldDeserializers the deserialization information for the current model -// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful -func (m *ItemCopilotBillingSeatsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { - res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) - res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotSeatDetailsFromDiscriminatorValue) - if err != nil { - return err - } - if val != nil { - res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable, len(val)) - for i, v := range val { - if v != nil { - res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable) - } - } - m.SetSeats(res) - } - return nil - } - res["total_seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetInt32Value() - if err != nil { - return err - } - if val != nil { - m.SetTotalSeats(val) - } - return nil - } - return res -} -// GetSeats gets the seats property value. The seats property -// returns a []CopilotSeatDetailsable when successful -func (m *ItemCopilotBillingSeatsGetResponse) GetSeats()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable) { - return m.seats -} -// GetTotalSeats gets the total_seats property value. The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. -// returns a *int32 when successful -func (m *ItemCopilotBillingSeatsGetResponse) GetTotalSeats()(*int32) { - return m.total_seats -} -// Serialize serializes information the current object -func (m *ItemCopilotBillingSeatsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { - if m.GetSeats() != nil { - cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSeats())) - for i, v := range m.GetSeats() { - if v != nil { - cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) - } - } - err := writer.WriteCollectionOfObjectValues("seats", cast) - if err != nil { - return err - } - } - { - err := writer.WriteInt32Value("total_seats", m.GetTotalSeats()) - if err != nil { - return err - } - } - { - err := writer.WriteAdditionalData(m.GetAdditionalData()) - if err != nil { - return err - } - } - return nil -} -// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -func (m *ItemCopilotBillingSeatsGetResponse) SetAdditionalData(value map[string]any)() { - m.additionalData = value -} -// SetSeats sets the seats property value. The seats property -func (m *ItemCopilotBillingSeatsGetResponse) SetSeats(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable)() { - m.seats = value -} -// SetTotalSeats sets the total_seats property value. The total number of Copilot seats the enterprise is being billed for. Users with access through multiple organizations or enterprise teams are only counted once. -func (m *ItemCopilotBillingSeatsGetResponse) SetTotalSeats(value *int32)() { - m.total_seats = value -} -type ItemCopilotBillingSeatsGetResponseable interface { - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable - GetSeats()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable) - GetTotalSeats()(*int32) - SetSeats(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotSeatDetailsable)() - SetTotalSeats(value *int32)() -} diff --git a/pkg/github/enterprises/item_copilot_billing_seats_request_builder.go b/pkg/github/enterprises/item_copilot_billing_seats_request_builder.go deleted file mode 100644 index e45c306f..00000000 --- a/pkg/github/enterprises/item_copilot_billing_seats_request_builder.go +++ /dev/null @@ -1,74 +0,0 @@ -package enterprises - -import ( - "context" - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" - i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" -) - -// ItemCopilotBillingSeatsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot\billing\seats -type ItemCopilotBillingSeatsRequestBuilder struct { - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder -} -// ItemCopilotBillingSeatsRequestBuilderGetQueryParameters > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription.Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once.For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array.Each seat object contains information about the assigned user's most recent Copilot activity. Users must havetelemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data,see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams.Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -type ItemCopilotBillingSeatsRequestBuilderGetQueryParameters struct { - // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - Page *int32 `uriparametername:"page"` - // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - Per_page *int32 `uriparametername:"per_page"` -} -// NewItemCopilotBillingSeatsRequestBuilderInternal instantiates a new ItemCopilotBillingSeatsRequestBuilder and sets the default values. -func NewItemCopilotBillingSeatsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSeatsRequestBuilder) { - m := &ItemCopilotBillingSeatsRequestBuilder{ - BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/billing/seats{?page*,per_page*}", pathParameters), - } - return m -} -// NewItemCopilotBillingSeatsRequestBuilder instantiates a new ItemCopilotBillingSeatsRequestBuilder and sets the default values. -func NewItemCopilotBillingSeatsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotBillingSeatsRequestBuilder) { - urlParams := make(map[string]string) - urlParams["request-raw-url"] = rawUrl - return NewItemCopilotBillingSeatsRequestBuilderInternal(urlParams, requestAdapter) -} -// Get > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription.Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once.For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array.Each seat object contains information about the assigned user's most recent Copilot activity. Users must havetelemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data,see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams.Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a ItemCopilotBillingSeatsGetResponseable when successful -// returns a BasicError error when the service returns a 401 status code -// returns a BasicError error when the service returns a 403 status code -// returns a BasicError error when the service returns a 404 status code -// returns a BasicError error when the service returns a 500 status code -// [API method documentation] -// -// [API method documentation]: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise -func (m *ItemCopilotBillingSeatsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotBillingSeatsRequestBuilderGetQueryParameters])(ItemCopilotBillingSeatsGetResponseable, error) { - requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); - if err != nil { - return nil, err - } - errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { - "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - } - res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCopilotBillingSeatsGetResponseFromDiscriminatorValue, errorMapping) - if err != nil { - return nil, err - } - if res == nil { - return nil, nil - } - return res.(ItemCopilotBillingSeatsGetResponseable), nil -} -// ToGetRequestInformation > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all Copilot seats currently being billed for across organizations or enterprise teams for an enterprise with a Copilot Business or Copilot Enterprise subscription.Users with access through multiple organizations or enterprise teams will only be counted toward `total_seats` once.For each organization or enterprise team which grants Copilot access to a user, a seat detail object will appear in the `seats` array.Each seat object contains information about the assigned user's most recent Copilot activity. Users must havetelemetry enabled in their IDE for Copilot in the IDE activity to be reflected in `last_activity_at`. For more information about activity data,see "[Reviewing user activity data for Copilot in your organization](https://docs.github.com/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-activity-related-to-github-copilot-in-your-organization/reviewing-user-activity-data-for-copilot-in-your-organization)."Only enterprise owners and billing managers can view assigned Copilot seats across their child organizations or enterprise teams.Personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a *RequestInformation when successful -func (m *ItemCopilotBillingSeatsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotBillingSeatsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { - requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) - requestInfo.Headers.TryAdd("Accept", "application/json") - return requestInfo, nil -} -// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. -// returns a *ItemCopilotBillingSeatsRequestBuilder when successful -func (m *ItemCopilotBillingSeatsRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotBillingSeatsRequestBuilder) { - return NewItemCopilotBillingSeatsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); -} diff --git a/pkg/github/enterprises/item_copilot_metrics_request_builder.go b/pkg/github/enterprises/item_copilot_metrics_request_builder.go deleted file mode 100644 index eb33a9da..00000000 --- a/pkg/github/enterprises/item_copilot_metrics_request_builder.go +++ /dev/null @@ -1,81 +0,0 @@ -package enterprises - -import ( - "context" - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" - i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" -) - -// ItemCopilotMetricsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot\metrics -type ItemCopilotMetricsRequestBuilder struct { - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder -} -// ItemCopilotMetricsRequestBuilderGetQueryParameters use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. 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.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -type ItemCopilotMetricsRequestBuilderGetQueryParameters 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"` -} -// NewItemCopilotMetricsRequestBuilderInternal instantiates a new ItemCopilotMetricsRequestBuilder and sets the default values. -func NewItemCopilotMetricsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotMetricsRequestBuilder) { - m := &ItemCopilotMetricsRequestBuilder{ - BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/metrics{?page*,per_page*,since*,until*}", pathParameters), - } - return m -} -// NewItemCopilotMetricsRequestBuilder instantiates a new ItemCopilotMetricsRequestBuilder and sets the default values. -func NewItemCopilotMetricsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotMetricsRequestBuilder) { - urlParams := make(map[string]string) - urlParams["request-raw-url"] = rawUrl - return NewItemCopilotMetricsRequestBuilderInternal(urlParams, requestAdapter) -} -// Get use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. 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.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a []CopilotUsageMetricsDayable when successful -// returns a BasicError error when the service returns a 403 status code -// returns a BasicError error when the service returns a 404 status code -// returns a BasicError error when the service returns a 422 status code -// 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-metrics#get-copilot-metrics-for-an-enterprise -func (m *ItemCopilotMetricsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotMetricsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable, error) { - requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); - if err != nil { - return nil, err - } - errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { - "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - } - res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotUsageMetricsDayFromDiscriminatorValue, errorMapping) - if err != nil { - return nil, err - } - val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable, len(res)) - for i, v := range res { - if v != nil { - val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable) - } - } - return val, nil -} -// ToGetRequestInformation use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. 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.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only enterprise owners and billing managers can view Copilot metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a *RequestInformation when successful -func (m *ItemCopilotMetricsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotMetricsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { - requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) - requestInfo.Headers.TryAdd("Accept", "application/json") - return requestInfo, nil -} -// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. -// returns a *ItemCopilotMetricsRequestBuilder when successful -func (m *ItemCopilotMetricsRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotMetricsRequestBuilder) { - return NewItemCopilotMetricsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); -} diff --git a/pkg/github/enterprises/item_copilot_request_builder.go b/pkg/github/enterprises/item_copilot_request_builder.go deleted file mode 100644 index 70df26b6..00000000 --- a/pkg/github/enterprises/item_copilot_request_builder.go +++ /dev/null @@ -1,38 +0,0 @@ -package enterprises - -import ( - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" -) - -// ItemCopilotRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot -type ItemCopilotRequestBuilder struct { - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder -} -// Billing the billing property -// returns a *ItemCopilotBillingRequestBuilder when successful -func (m *ItemCopilotRequestBuilder) Billing()(*ItemCopilotBillingRequestBuilder) { - return NewItemCopilotBillingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) -} -// NewItemCopilotRequestBuilderInternal instantiates a new ItemCopilotRequestBuilder and sets the default values. -func NewItemCopilotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotRequestBuilder) { - m := &ItemCopilotRequestBuilder{ - BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot", pathParameters), - } - return m -} -// NewItemCopilotRequestBuilder instantiates a new ItemCopilotRequestBuilder and sets the default values. -func NewItemCopilotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotRequestBuilder) { - urlParams := make(map[string]string) - urlParams["request-raw-url"] = rawUrl - return NewItemCopilotRequestBuilderInternal(urlParams, requestAdapter) -} -// Metrics the metrics property -// returns a *ItemCopilotMetricsRequestBuilder when successful -func (m *ItemCopilotRequestBuilder) Metrics()(*ItemCopilotMetricsRequestBuilder) { - return NewItemCopilotMetricsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) -} -// Usage the usage property -// returns a *ItemCopilotUsageRequestBuilder when successful -func (m *ItemCopilotRequestBuilder) Usage()(*ItemCopilotUsageRequestBuilder) { - return NewItemCopilotUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) -} diff --git a/pkg/github/enterprises/item_copilot_usage_request_builder.go b/pkg/github/enterprises/item_copilot_usage_request_builder.go deleted file mode 100644 index 9f2d0db5..00000000 --- a/pkg/github/enterprises/item_copilot_usage_request_builder.go +++ /dev/null @@ -1,81 +0,0 @@ -package enterprises - -import ( - "context" - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" - i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" -) - -// ItemCopilotUsageRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\copilot\usage -type ItemCopilotUsageRequestBuilder struct { - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder -} -// ItemCopilotUsageRequestBuilderGetQueryParameters > [!NOTE]> This endpoint is in public preview and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for 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.The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time.Only owners and billing managers can view Copilot usage metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -type ItemCopilotUsageRequestBuilderGetQueryParameters struct { - // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - Page *int32 `uriparametername:"page"` - // The number of days of metrics to display per page (max 28). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." - Per_page *int32 `uriparametername:"per_page"` - // Show usage metrics since this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`). Maximum value is 28 days ago. - Since *string `uriparametername:"since"` - // Show usage metrics until this date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`) and should not preceed the `since` date if it is passed. - Until *string `uriparametername:"until"` -} -// NewItemCopilotUsageRequestBuilderInternal instantiates a new ItemCopilotUsageRequestBuilder and sets the default values. -func NewItemCopilotUsageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotUsageRequestBuilder) { - m := &ItemCopilotUsageRequestBuilder{ - BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/copilot/usage{?page*,per_page*,since*,until*}", pathParameters), - } - return m -} -// NewItemCopilotUsageRequestBuilder instantiates a new ItemCopilotUsageRequestBuilder and sets the default values. -func NewItemCopilotUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCopilotUsageRequestBuilder) { - urlParams := make(map[string]string) - urlParams["request-raw-url"] = rawUrl - return NewItemCopilotUsageRequestBuilderInternal(urlParams, requestAdapter) -} -// Get > [!NOTE]> This endpoint is in public preview and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for 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.The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time.Only owners and billing managers can view Copilot usage metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a []CopilotUsageMetricsable when successful -// returns a BasicError error when the service returns a 401 status code -// returns a BasicError error when the service returns a 403 status code -// returns a BasicError error when the service returns a 404 status code -// returns a BasicError error when the service returns a 500 status code -// [API method documentation] -// -// [API method documentation]: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members -func (m *ItemCopilotUsageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotUsageRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable, error) { - requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); - if err != nil { - return nil, err - } - errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { - "401": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - } - res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotUsageMetricsFromDiscriminatorValue, errorMapping) - if err != nil { - return nil, err - } - val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable, len(res)) - for i, v := range res { - if v != nil { - val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsable) - } - } - return val, nil -} -// ToGetRequestInformation > [!NOTE]> This endpoint is in public preview and is subject to change.You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDEfor all users across organizations with access to Copilot within your enterprise, with a further breakdown of suggestions, acceptances,and number of active users by editor and language for each day. See the response schema tab for detailed metrics definitions.The response contains metrics for 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.The time zone in the response is in UTC time, that means that the cutoff time for the "day" is UTC time.Only owners and billing managers can view Copilot usage metrics for the enterprise.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a *RequestInformation when successful -func (m *ItemCopilotUsageRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCopilotUsageRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { - requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) - requestInfo.Headers.TryAdd("Accept", "application/json") - return requestInfo, nil -} -// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. -// returns a *ItemCopilotUsageRequestBuilder when successful -func (m *ItemCopilotUsageRequestBuilder) WithUrl(rawUrl string)(*ItemCopilotUsageRequestBuilder) { - return NewItemCopilotUsageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); -} diff --git a/pkg/github/enterprises/item_secret_scanning_alerts_request_builder.go b/pkg/github/enterprises/item_secret_scanning_alerts_request_builder.go index 28418810..b8479ea6 100644 --- a/pkg/github/enterprises/item_secret_scanning_alerts_request_builder.go +++ b/pkg/github/enterprises/item_secret_scanning_alerts_request_builder.go @@ -27,7 +27,7 @@ type ItemSecretScanningAlertsRequestBuilderGetQueryParameters struct { Per_page *int32 `uriparametername:"per_page"` // A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. Resolution *string `uriparametername:"resolution"` - // A comma-separated list of secret types to return. By default all secret types are returned.See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)"for a complete list of secret types. + // A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. Secret_type *string `uriparametername:"secret_type"` // The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. Sort *i001db24e943d0f84422b7e2ee3ebec420ca587ebd5e378cf50225876c7468a70.GetSortQueryParameterType `uriparametername:"sort"` diff --git a/pkg/github/enterprises/item_team_item_copilot_metrics_request_builder.go b/pkg/github/enterprises/item_team_item_copilot_metrics_request_builder.go deleted file mode 100644 index 24dd7c96..00000000 --- a/pkg/github/enterprises/item_team_item_copilot_metrics_request_builder.go +++ /dev/null @@ -1,81 +0,0 @@ -package enterprises - -import ( - "context" - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" - i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" -) - -// ItemTeamItemCopilotMetricsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\team\{team_slug}\copilot\metrics -type ItemTeamItemCopilotMetricsRequestBuilder struct { - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder -} -// ItemTeamItemCopilotMetricsRequestBuilderGetQueryParameters > [!NOTE]> This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. 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 enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -type ItemTeamItemCopilotMetricsRequestBuilderGetQueryParameters 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"` -} -// NewItemTeamItemCopilotMetricsRequestBuilderInternal instantiates a new ItemTeamItemCopilotMetricsRequestBuilder and sets the default values. -func NewItemTeamItemCopilotMetricsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotMetricsRequestBuilder) { - m := &ItemTeamItemCopilotMetricsRequestBuilder{ - BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/team/{team_slug}/copilot/metrics{?page*,per_page*,since*,until*}", pathParameters), - } - return m -} -// NewItemTeamItemCopilotMetricsRequestBuilder instantiates a new ItemTeamItemCopilotMetricsRequestBuilder and sets the default values. -func NewItemTeamItemCopilotMetricsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamItemCopilotMetricsRequestBuilder) { - urlParams := make(map[string]string) - urlParams["request-raw-url"] = rawUrl - return NewItemTeamItemCopilotMetricsRequestBuilderInternal(urlParams, requestAdapter) -} -// Get > [!NOTE]> This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. 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 enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a []CopilotUsageMetricsDayable when successful -// returns a BasicError error when the service returns a 403 status code -// returns a BasicError error when the service returns a 404 status code -// returns a BasicError error when the service returns a 422 status code -// 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-metrics#get-copilot-metrics-for-an-enterprise-team -func (m *ItemTeamItemCopilotMetricsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamItemCopilotMetricsRequestBuilderGetQueryParameters])([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable, error) { - requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); - if err != nil { - return nil, err - } - errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { - "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - "500": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, - } - res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCopilotUsageMetricsDayFromDiscriminatorValue, errorMapping) - if err != nil { - return nil, err - } - val := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable, len(res)) - for i, v := range res { - if v != nil { - val[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CopilotUsageMetricsDayable) - } - } - return val, nil -} -// ToGetRequestInformation > [!NOTE]> This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."Use this endpoint to see a breakdown of aggregated metrics for various GitHub Copilot features. See the response schema tab for detailed metrics definitions.The response contains metrics for up to 28 days prior. 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 enterprise team had **five or more members with active Copilot licenses** on that day, as evaluated at the end of that day.To access this endpoint, the Copilot Metrics API access policy must be enabled or set to "no policy" for the enterprise within GitHub settings.Only owners and billing managers for the enterprise that contains the enterprise team can view Copilot metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a *RequestInformation when successful -func (m *ItemTeamItemCopilotMetricsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamItemCopilotMetricsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { - requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) - requestInfo.Headers.TryAdd("Accept", "application/json") - return requestInfo, nil -} -// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. -// returns a *ItemTeamItemCopilotMetricsRequestBuilder when successful -func (m *ItemTeamItemCopilotMetricsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamItemCopilotMetricsRequestBuilder) { - return NewItemTeamItemCopilotMetricsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); -} diff --git a/pkg/github/enterprises/item_team_item_copilot_request_builder.go b/pkg/github/enterprises/item_team_item_copilot_request_builder.go deleted file mode 100644 index e726cd74..00000000 --- a/pkg/github/enterprises/item_team_item_copilot_request_builder.go +++ /dev/null @@ -1,33 +0,0 @@ -package enterprises - -import ( - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" -) - -// ItemTeamItemCopilotRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\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}/enterprises/{enterprise}/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) -} -// Metrics the metrics property -// returns a *ItemTeamItemCopilotMetricsRequestBuilder when successful -func (m *ItemTeamItemCopilotRequestBuilder) Metrics()(*ItemTeamItemCopilotMetricsRequestBuilder) { - return NewItemTeamItemCopilotMetricsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.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/enterprises/item_team_item_copilot_usage_request_builder.go b/pkg/github/enterprises/item_team_item_copilot_usage_request_builder.go deleted file mode 100644 index b0409e71..00000000 --- a/pkg/github/enterprises/item_team_item_copilot_usage_request_builder.go +++ /dev/null @@ -1,81 +0,0 @@ -package enterprises - -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 \enterprises\{enterprise}\team\{team_slug}\copilot\usage -type ItemTeamItemCopilotUsageRequestBuilder struct { - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder -} -// ItemTeamItemCopilotUsageRequestBuilderGetQueryParameters > [!NOTE]> This endpoint is in public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."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 an enterprise 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 enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day.Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` 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}/enterprises/{enterprise}/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 public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."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 an enterprise 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 enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day.Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a []CopilotUsageMetricsable when successful -// returns a BasicError error when the service returns a 401 status code -// returns a BasicError error when the service returns a 403 status code -// returns a BasicError error when the service returns a 404 status code -// returns a BasicError error when the service returns a 500 status code -// [API method documentation] -// -// [API method documentation]: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-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 public preview and is subject to change. This endpoint is only applicable to dedicated enterprise accounts for Copilot Business. See "[About enterprise accounts for Copilot Business](https://docs.github.com/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)."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 an enterprise 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 enterprise team had five or more members with active Copilot licenses, as evaluated at the end of that day.Owners and billing managers for the enterprise that contains the enterprise team can view Copilot usage metrics for the enterprise team.OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot` or `read:enterprise` scopes to use this endpoint. -// returns a *RequestInformation when successful -func (m *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/enterprises/item_team_request_builder.go b/pkg/github/enterprises/item_team_request_builder.go deleted file mode 100644 index 8a781d72..00000000 --- a/pkg/github/enterprises/item_team_request_builder.go +++ /dev/null @@ -1,35 +0,0 @@ -package enterprises - -import ( - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" -) - -// ItemTeamRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\team -type ItemTeamRequestBuilder struct { - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder -} -// ByTeam_slug gets an item from the github.com/octokit/go-sdk/pkg/github.enterprises.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}/enterprises/{enterprise}/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/enterprises/item_team_with_team_escaped_slug_item_request_builder.go b/pkg/github/enterprises/item_team_with_team_escaped_slug_item_request_builder.go deleted file mode 100644 index 6bec05ea..00000000 --- a/pkg/github/enterprises/item_team_with_team_escaped_slug_item_request_builder.go +++ /dev/null @@ -1,28 +0,0 @@ -package enterprises - -import ( - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" -) - -// ItemTeamWithTeam_slugItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\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}/enterprises/{enterprise}/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/enterprises/with_enterprise_item_request_builder.go b/pkg/github/enterprises/with_enterprise_item_request_builder.go index f07e04af..cccc8d03 100644 --- a/pkg/github/enterprises/with_enterprise_item_request_builder.go +++ b/pkg/github/enterprises/with_enterprise_item_request_builder.go @@ -8,6 +8,11 @@ import ( type WithEnterpriseItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } +// CodeSecurity the codeSecurity property +// returns a *ItemCodeSecurityRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) CodeSecurity()(*ItemCodeSecurityRequestBuilder) { + return NewItemCodeSecurityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} // NewWithEnterpriseItemRequestBuilderInternal instantiates a new WithEnterpriseItemRequestBuilder and sets the default values. func NewWithEnterpriseItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithEnterpriseItemRequestBuilder) { m := &WithEnterpriseItemRequestBuilder{ @@ -21,11 +26,6 @@ func NewWithEnterpriseItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f urlParams["request-raw-url"] = rawUrl return NewWithEnterpriseItemRequestBuilderInternal(urlParams, requestAdapter) } -// Copilot the copilot property -// returns a *ItemCopilotRequestBuilder when successful -func (m *WithEnterpriseItemRequestBuilder) Copilot()(*ItemCopilotRequestBuilder) { - return NewItemCopilotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) -} // Dependabot the dependabot property // returns a *ItemDependabotRequestBuilder when successful func (m *WithEnterpriseItemRequestBuilder) Dependabot()(*ItemDependabotRequestBuilder) { @@ -36,8 +36,3 @@ func (m *WithEnterpriseItemRequestBuilder) Dependabot()(*ItemDependabotRequestBu func (m *WithEnterpriseItemRequestBuilder) SecretScanning()(*ItemSecretScanningRequestBuilder) { return NewItemSecretScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Team the team property -// returns a *ItemTeamRequestBuilder when successful -func (m *WithEnterpriseItemRequestBuilder) Team()(*ItemTeamRequestBuilder) { - return NewItemTeamRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) -} diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index 02e8f68a..90ecf512 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "6198535C8618DF52C604457271227C60CB25FBE843929DDB9970F53DB37EB9E31AEEA0A70CC974BC8F670CAEC656E55058A944AF09F1519B83FA55EA8A0076DA", + "descriptionHash": "54208FD0E974CC1715543AD344E8EB72FE62F45838301766C1CFBE3A6EDF1B14B8CFC3A84C4495B0B29B749D231789DB35F3CBFA101624FD7E5BF8FB1ECB51DD", "descriptionLocation": "../../../../../schemas/api.github.com.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.19.0", diff --git a/pkg/github/models/api_overview_escaped_domains.go b/pkg/github/models/api_overview_escaped_domains.go index 32950e02..b8d2838e 100644 --- a/pkg/github/models/api_overview_escaped_domains.go +++ b/pkg/github/models/api_overview_escaped_domains.go @@ -7,6 +7,8 @@ import ( type ApiOverview_domains struct { // The actions property actions []string + // The actions_inbound property + actions_inbound ApiOverview_domains_actions_inboundable // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any // The artifact_attestations property @@ -37,6 +39,11 @@ func CreateApiOverview_domainsFromDiscriminatorValue(parseNode i878a80d2330e89d2 func (m *ApiOverview_domains) GetActions()([]string) { return m.actions } +// GetActionsInbound gets the actions_inbound property value. The actions_inbound property +// returns a ApiOverview_domains_actions_inboundable when successful +func (m *ApiOverview_domains) GetActionsInbound()(ApiOverview_domains_actions_inboundable) { + return m.actions_inbound +} // GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. // returns a map[string]any when successful func (m *ApiOverview_domains) GetAdditionalData()(map[string]any) { @@ -77,6 +84,16 @@ func (m *ApiOverview_domains) GetFieldDeserializers()(map[string]func(i878a80d23 } return nil } + res["actions_inbound"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateApiOverview_domains_actions_inboundFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActionsInbound(val.(ApiOverview_domains_actions_inboundable)) + } + return nil + } res["artifact_attestations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateApiOverview_domains_artifact_attestationsFromDiscriminatorValue) if err != nil { @@ -171,6 +188,12 @@ func (m *ApiOverview_domains) Serialize(writer i878a80d2330e89d26896388a3f487eef return err } } + { + err := writer.WriteObjectValue("actions_inbound", m.GetActionsInbound()) + if err != nil { + return err + } + } { err := writer.WriteObjectValue("artifact_attestations", m.GetArtifactAttestations()) if err != nil { @@ -213,6 +236,10 @@ func (m *ApiOverview_domains) Serialize(writer i878a80d2330e89d26896388a3f487eef func (m *ApiOverview_domains) SetActions(value []string)() { m.actions = value } +// SetActionsInbound sets the actions_inbound property value. The actions_inbound property +func (m *ApiOverview_domains) SetActionsInbound(value ApiOverview_domains_actions_inboundable)() { + m.actions_inbound = value +} // SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. func (m *ApiOverview_domains) SetAdditionalData(value map[string]any)() { m.additionalData = value @@ -241,12 +268,14 @@ type ApiOverview_domainsable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetActions()([]string) + GetActionsInbound()(ApiOverview_domains_actions_inboundable) GetArtifactAttestations()(ApiOverview_domains_artifact_attestationsable) GetCodespaces()([]string) GetCopilot()([]string) GetPackages()([]string) GetWebsite()([]string) SetActions(value []string)() + SetActionsInbound(value ApiOverview_domains_actions_inboundable)() SetArtifactAttestations(value ApiOverview_domains_artifact_attestationsable)() SetCodespaces(value []string)() SetCopilot(value []string)() diff --git a/pkg/github/models/api_overview_escaped_domains_escaped_actions_escaped_inbound.go b/pkg/github/models/api_overview_escaped_domains_escaped_actions_escaped_inbound.go new file mode 100644 index 00000000..68f3d2f2 --- /dev/null +++ b/pkg/github/models/api_overview_escaped_domains_escaped_actions_escaped_inbound.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiOverview_domains_actions_inbound struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The full_domains property + full_domains []string + // The wildcard_domains property + wildcard_domains []string +} +// NewApiOverview_domains_actions_inbound instantiates a new ApiOverview_domains_actions_inbound and sets the default values. +func NewApiOverview_domains_actions_inbound()(*ApiOverview_domains_actions_inbound) { + m := &ApiOverview_domains_actions_inbound{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiOverview_domains_actions_inboundFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiOverview_domains_actions_inboundFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiOverview_domains_actions_inbound(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ApiOverview_domains_actions_inbound) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ApiOverview_domains_actions_inbound) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["full_domains"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetFullDomains(res) + } + return nil + } + res["wildcard_domains"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetWildcardDomains(res) + } + return nil + } + return res +} +// GetFullDomains gets the full_domains property value. The full_domains property +// returns a []string when successful +func (m *ApiOverview_domains_actions_inbound) GetFullDomains()([]string) { + return m.full_domains +} +// GetWildcardDomains gets the wildcard_domains property value. The wildcard_domains property +// returns a []string when successful +func (m *ApiOverview_domains_actions_inbound) GetWildcardDomains()([]string) { + return m.wildcard_domains +} +// Serialize serializes information the current object +func (m *ApiOverview_domains_actions_inbound) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetFullDomains() != nil { + err := writer.WriteCollectionOfStringValues("full_domains", m.GetFullDomains()) + if err != nil { + return err + } + } + if m.GetWildcardDomains() != nil { + err := writer.WriteCollectionOfStringValues("wildcard_domains", m.GetWildcardDomains()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ApiOverview_domains_actions_inbound) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFullDomains sets the full_domains property value. The full_domains property +func (m *ApiOverview_domains_actions_inbound) SetFullDomains(value []string)() { + m.full_domains = value +} +// SetWildcardDomains sets the wildcard_domains property value. The wildcard_domains property +func (m *ApiOverview_domains_actions_inbound) SetWildcardDomains(value []string)() { + m.wildcard_domains = value +} +type ApiOverview_domains_actions_inboundable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFullDomains()([]string) + GetWildcardDomains()([]string) + SetFullDomains(value []string)() + SetWildcardDomains(value []string)() +} diff --git a/pkg/github/models/code_scanning_autofix.go b/pkg/github/models/code_scanning_autofix.go new file mode 100644 index 00000000..bd6d20c8 --- /dev/null +++ b/pkg/github/models/code_scanning_autofix.go @@ -0,0 +1,134 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAutofix struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The description of an autofix. + description *string + // The start time of an autofix in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The status of an autofix. + status *CodeScanningAutofixStatus +} +// NewCodeScanningAutofix instantiates a new CodeScanningAutofix and sets the default values. +func NewCodeScanningAutofix()(*CodeScanningAutofix) { + m := &CodeScanningAutofix{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAutofixFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAutofixFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAutofix(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningAutofix) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description of an autofix. +// returns a *string when successful +func (m *CodeScanningAutofix) 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 *CodeScanningAutofix) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["started_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetStartedAt(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAutofixStatus) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*CodeScanningAutofixStatus)) + } + return nil + } + return res +} +// GetStartedAt gets the started_at property value. The start time of an autofix in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAutofix) GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.started_at +} +// GetStatus gets the status property value. The status of an autofix. +// returns a *CodeScanningAutofixStatus when successful +func (m *CodeScanningAutofix) GetStatus()(*CodeScanningAutofixStatus) { + return m.status +} +// Serialize serializes information the current object +func (m *CodeScanningAutofix) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeScanningAutofix) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description of an autofix. +func (m *CodeScanningAutofix) SetDescription(value *string)() { + m.description = value +} +// SetStartedAt sets the started_at property value. The start time of an autofix in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAutofix) SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.started_at = value +} +// SetStatus sets the status property value. The status of an autofix. +func (m *CodeScanningAutofix) SetStatus(value *CodeScanningAutofixStatus)() { + m.status = value +} +type CodeScanningAutofixable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetStatus()(*CodeScanningAutofixStatus) + SetDescription(value *string)() + SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetStatus(value *CodeScanningAutofixStatus)() +} diff --git a/pkg/github/models/code_scanning_autofix503_error.go b/pkg/github/models/code_scanning_autofix503_error.go new file mode 100644 index 00000000..8458096e --- /dev/null +++ b/pkg/github/models/code_scanning_autofix503_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 CodeScanningAutofix503Error 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 +} +// NewCodeScanningAutofix503Error instantiates a new CodeScanningAutofix503Error and sets the default values. +func NewCodeScanningAutofix503Error()(*CodeScanningAutofix503Error) { + m := &CodeScanningAutofix503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAutofix503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAutofix503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAutofix503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningAutofix503Error) 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 *CodeScanningAutofix503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningAutofix503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningAutofix503Error) 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 *CodeScanningAutofix503Error) 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 *CodeScanningAutofix503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningAutofix503Error) 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 *CodeScanningAutofix503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningAutofix503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningAutofix503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAutofix503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningAutofix503Errorable 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/code_scanning_autofix_commits.go b/pkg/github/models/code_scanning_autofix_commits.go new file mode 100644 index 00000000..1851170f --- /dev/null +++ b/pkg/github/models/code_scanning_autofix_commits.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningAutofixCommits commit an autofix for a code scanning alert +type CodeScanningAutofixCommits struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Commit message to be used. + message *string + // The Git reference of target branch for the commit. Branch needs to already exist. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. + target_ref *string +} +// NewCodeScanningAutofixCommits instantiates a new CodeScanningAutofixCommits and sets the default values. +func NewCodeScanningAutofixCommits()(*CodeScanningAutofixCommits) { + m := &CodeScanningAutofixCommits{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAutofixCommitsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAutofixCommitsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAutofixCommits(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningAutofixCommits) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAutofixCommits) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["target_ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetRef(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. Commit message to be used. +// returns a *string when successful +func (m *CodeScanningAutofixCommits) GetMessage()(*string) { + return m.message +} +// GetTargetRef gets the target_ref property value. The Git reference of target branch for the commit. Branch needs to already exist. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +// returns a *string when successful +func (m *CodeScanningAutofixCommits) GetTargetRef()(*string) { + return m.target_ref +} +// Serialize serializes information the current object +func (m *CodeScanningAutofixCommits) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_ref", m.GetTargetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeScanningAutofixCommits) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. Commit message to be used. +func (m *CodeScanningAutofixCommits) SetMessage(value *string)() { + m.message = value +} +// SetTargetRef sets the target_ref property value. The Git reference of target branch for the commit. Branch needs to already exist. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +func (m *CodeScanningAutofixCommits) SetTargetRef(value *string)() { + m.target_ref = value +} +type CodeScanningAutofixCommitsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetTargetRef()(*string) + SetMessage(value *string)() + SetTargetRef(value *string)() +} diff --git a/pkg/github/models/code_scanning_autofix_commits_response.go b/pkg/github/models/code_scanning_autofix_commits_response.go new file mode 100644 index 00000000..c6be1ea7 --- /dev/null +++ b/pkg/github/models/code_scanning_autofix_commits_response.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAutofixCommitsResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // SHA of commit with autofix. + sha *string + // The Git reference of target branch for the commit. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. + target_ref *string +} +// NewCodeScanningAutofixCommitsResponse instantiates a new CodeScanningAutofixCommitsResponse and sets the default values. +func NewCodeScanningAutofixCommitsResponse()(*CodeScanningAutofixCommitsResponse) { + m := &CodeScanningAutofixCommitsResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAutofixCommitsResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAutofixCommitsResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAutofixCommitsResponse(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CodeScanningAutofixCommitsResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAutofixCommitsResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + res["target_ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetRef(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. SHA of commit with autofix. +// returns a *string when successful +func (m *CodeScanningAutofixCommitsResponse) GetSha()(*string) { + return m.sha +} +// GetTargetRef gets the target_ref property value. The Git reference of target branch for the commit. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +// returns a *string when successful +func (m *CodeScanningAutofixCommitsResponse) GetTargetRef()(*string) { + return m.target_ref +} +// Serialize serializes information the current object +func (m *CodeScanningAutofixCommitsResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_ref", m.GetTargetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeScanningAutofixCommitsResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. SHA of commit with autofix. +func (m *CodeScanningAutofixCommitsResponse) SetSha(value *string)() { + m.sha = value +} +// SetTargetRef sets the target_ref property value. The Git reference of target branch for the commit. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +func (m *CodeScanningAutofixCommitsResponse) SetTargetRef(value *string)() { + m.target_ref = value +} +type CodeScanningAutofixCommitsResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetTargetRef()(*string) + SetSha(value *string)() + SetTargetRef(value *string)() +} diff --git a/pkg/github/models/code_scanning_autofix_commits_response503_error.go b/pkg/github/models/code_scanning_autofix_commits_response503_error.go new file mode 100644 index 00000000..31ec6428 --- /dev/null +++ b/pkg/github/models/code_scanning_autofix_commits_response503_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 CodeScanningAutofixCommitsResponse503Error 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 +} +// NewCodeScanningAutofixCommitsResponse503Error instantiates a new CodeScanningAutofixCommitsResponse503Error and sets the default values. +func NewCodeScanningAutofixCommitsResponse503Error()(*CodeScanningAutofixCommitsResponse503Error) { + m := &CodeScanningAutofixCommitsResponse503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAutofixCommitsResponse503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAutofixCommitsResponse503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAutofixCommitsResponse503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningAutofixCommitsResponse503Error) 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 *CodeScanningAutofixCommitsResponse503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningAutofixCommitsResponse503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningAutofixCommitsResponse503Error) 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 *CodeScanningAutofixCommitsResponse503Error) 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 *CodeScanningAutofixCommitsResponse503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningAutofixCommitsResponse503Error) 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 *CodeScanningAutofixCommitsResponse503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningAutofixCommitsResponse503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningAutofixCommitsResponse503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAutofixCommitsResponse503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningAutofixCommitsResponse503Errorable 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/code_scanning_autofix_status.go b/pkg/github/models/code_scanning_autofix_status.go new file mode 100644 index 00000000..c5b2cde0 --- /dev/null +++ b/pkg/github/models/code_scanning_autofix_status.go @@ -0,0 +1,40 @@ +package models +// The status of an autofix. +type CodeScanningAutofixStatus int + +const ( + PENDING_CODESCANNINGAUTOFIXSTATUS CodeScanningAutofixStatus = iota + ERROR_CODESCANNINGAUTOFIXSTATUS + SUCCESS_CODESCANNINGAUTOFIXSTATUS + OUTDATED_CODESCANNINGAUTOFIXSTATUS +) + +func (i CodeScanningAutofixStatus) String() string { + return []string{"pending", "error", "success", "outdated"}[i] +} +func ParseCodeScanningAutofixStatus(v string) (any, error) { + result := PENDING_CODESCANNINGAUTOFIXSTATUS + switch v { + case "pending": + result = PENDING_CODESCANNINGAUTOFIXSTATUS + case "error": + result = ERROR_CODESCANNINGAUTOFIXSTATUS + case "success": + result = SUCCESS_CODESCANNINGAUTOFIXSTATUS + case "outdated": + result = OUTDATED_CODESCANNINGAUTOFIXSTATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAutofixStatus(values []CodeScanningAutofixStatus) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAutofixStatus) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_default_setup_escaped_languages.go b/pkg/github/models/code_scanning_default_setup_escaped_languages.go index 78b417f4..4eb18e8a 100644 --- a/pkg/github/models/code_scanning_default_setup_escaped_languages.go +++ b/pkg/github/models/code_scanning_default_setup_escaped_languages.go @@ -2,7 +2,8 @@ package models type CodeScanningDefaultSetup_languages int const ( - CCPP_CODESCANNINGDEFAULTSETUP_LANGUAGES CodeScanningDefaultSetup_languages = iota + ACTIONS_CODESCANNINGDEFAULTSETUP_LANGUAGES CodeScanningDefaultSetup_languages = iota + CCPP_CODESCANNINGDEFAULTSETUP_LANGUAGES CSHARP_CODESCANNINGDEFAULTSETUP_LANGUAGES GO_CODESCANNINGDEFAULTSETUP_LANGUAGES JAVAKOTLIN_CODESCANNINGDEFAULTSETUP_LANGUAGES @@ -15,11 +16,13 @@ const ( ) func (i CodeScanningDefaultSetup_languages) String() string { - return []string{"c-cpp", "csharp", "go", "java-kotlin", "javascript-typescript", "javascript", "python", "ruby", "typescript", "swift"}[i] + return []string{"actions", "c-cpp", "csharp", "go", "java-kotlin", "javascript-typescript", "javascript", "python", "ruby", "typescript", "swift"}[i] } func ParseCodeScanningDefaultSetup_languages(v string) (any, error) { - result := CCPP_CODESCANNINGDEFAULTSETUP_LANGUAGES + result := ACTIONS_CODESCANNINGDEFAULTSETUP_LANGUAGES switch v { + case "actions": + result = ACTIONS_CODESCANNINGDEFAULTSETUP_LANGUAGES case "c-cpp": result = CCPP_CODESCANNINGDEFAULTSETUP_LANGUAGES case "csharp": diff --git a/pkg/github/models/code_scanning_default_setup_update_escaped_languages.go b/pkg/github/models/code_scanning_default_setup_update_escaped_languages.go index c1f3a1f8..b6b9ec8f 100644 --- a/pkg/github/models/code_scanning_default_setup_update_escaped_languages.go +++ b/pkg/github/models/code_scanning_default_setup_update_escaped_languages.go @@ -2,7 +2,8 @@ package models type CodeScanningDefaultSetupUpdate_languages int const ( - CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES CodeScanningDefaultSetupUpdate_languages = iota + ACTIONS_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES CodeScanningDefaultSetupUpdate_languages = iota + CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES CSHARP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES GO_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES JAVAKOTLIN_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES @@ -13,11 +14,13 @@ const ( ) func (i CodeScanningDefaultSetupUpdate_languages) String() string { - return []string{"c-cpp", "csharp", "go", "java-kotlin", "javascript-typescript", "python", "ruby", "swift"}[i] + return []string{"actions", "c-cpp", "csharp", "go", "java-kotlin", "javascript-typescript", "python", "ruby", "swift"}[i] } func ParseCodeScanningDefaultSetupUpdate_languages(v string) (any, error) { - result := CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + result := ACTIONS_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES switch v { + case "actions": + result = ACTIONS_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES case "c-cpp": result = CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES case "csharp": diff --git a/pkg/github/models/custom_property_set_payload.go b/pkg/github/models/custom_property_set_payload.go new file mode 100644 index 00000000..324fc9ad --- /dev/null +++ b/pkg/github/models/custom_property_set_payload.go @@ -0,0 +1,304 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CustomPropertySetPayload custom property set payload +type CustomPropertySetPayload 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 CustomPropertySetPayload_CustomPropertySetPayload_default_valueable + // Short description of the property + description *string + // Whether the property is required. + required *bool + // The type of the value for the property + value_type *CustomPropertySetPayload_value_type +} +// CustomPropertySetPayload_CustomPropertySetPayload_default_value composed type wrapper for classes string, []string +type CustomPropertySetPayload_CustomPropertySetPayload_default_value struct { + // Composed type representation for type string + customPropertySetPayload_default_valueString *string + // Composed type representation for type []string + string []string +} +// NewCustomPropertySetPayload_CustomPropertySetPayload_default_value instantiates a new CustomPropertySetPayload_CustomPropertySetPayload_default_value and sets the default values. +func NewCustomPropertySetPayload_CustomPropertySetPayload_default_value()(*CustomPropertySetPayload_CustomPropertySetPayload_default_value) { + m := &CustomPropertySetPayload_CustomPropertySetPayload_default_value{ + } + return m +} +// CreateCustomPropertySetPayload_CustomPropertySetPayload_default_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomPropertySetPayload_CustomPropertySetPayload_default_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCustomPropertySetPayload_CustomPropertySetPayload_default_value() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + } + } + } + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetCustomPropertySetPayloadDefaultValueString(val) + } else if val, err := parseNode.GetCollectionOfPrimitiveValues("string"); val != nil { + if err != nil { + return nil, err + } + cast := make([]string, len(val)) + for i, v := range val { + if v != nil { + cast[i] = *(v.(*string)) + } + } + result.SetString(cast) + } + return result, nil +} +// GetCustomPropertySetPayloadDefaultValueString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *CustomPropertySetPayload_CustomPropertySetPayload_default_value) GetCustomPropertySetPayloadDefaultValueString()(*string) { + return m.customPropertySetPayload_default_valueString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CustomPropertySetPayload_CustomPropertySetPayload_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 *CustomPropertySetPayload_CustomPropertySetPayload_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 *CustomPropertySetPayload_CustomPropertySetPayload_default_value) GetString()([]string) { + return m.string +} +// Serialize serializes information the current object +func (m *CustomPropertySetPayload_CustomPropertySetPayload_default_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCustomPropertySetPayloadDefaultValueString() != nil { + err := writer.WriteStringValue("", m.GetCustomPropertySetPayloadDefaultValueString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteCollectionOfStringValues("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetCustomPropertySetPayloadDefaultValueString sets the string property value. Composed type representation for type string +func (m *CustomPropertySetPayload_CustomPropertySetPayload_default_value) SetCustomPropertySetPayloadDefaultValueString(value *string)() { + m.customPropertySetPayload_default_valueString = value +} +// SetString sets the string property value. Composed type representation for type []string +func (m *CustomPropertySetPayload_CustomPropertySetPayload_default_value) SetString(value []string)() { + m.string = value +} +type CustomPropertySetPayload_CustomPropertySetPayload_default_valueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCustomPropertySetPayloadDefaultValueString()(*string) + GetString()([]string) + SetCustomPropertySetPayloadDefaultValueString(value *string)() + SetString(value []string)() +} +// NewCustomPropertySetPayload instantiates a new CustomPropertySetPayload and sets the default values. +func NewCustomPropertySetPayload()(*CustomPropertySetPayload) { + m := &CustomPropertySetPayload{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCustomPropertySetPayloadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomPropertySetPayloadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCustomPropertySetPayload(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CustomPropertySetPayload) 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 *CustomPropertySetPayload) GetAllowedValues()([]string) { + return m.allowed_values +} +// GetDefaultValue gets the default_value property value. Default value of the property +// returns a CustomPropertySetPayload_CustomPropertySetPayload_default_valueable when successful +func (m *CustomPropertySetPayload) GetDefaultValue()(CustomPropertySetPayload_CustomPropertySetPayload_default_valueable) { + return m.default_value +} +// GetDescription gets the description property value. Short description of the property +// returns a *string when successful +func (m *CustomPropertySetPayload) 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 *CustomPropertySetPayload) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_values"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAllowedValues(res) + } + return nil + } + res["default_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCustomPropertySetPayload_CustomPropertySetPayload_default_valueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDefaultValue(val.(CustomPropertySetPayload_CustomPropertySetPayload_default_valueable)) + } + return nil + } + res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequired(val) + } + return nil + } + res["value_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCustomPropertySetPayload_value_type) + if err != nil { + return err + } + if val != nil { + m.SetValueType(val.(*CustomPropertySetPayload_value_type)) + } + return nil + } + return res +} +// GetRequired gets the required property value. Whether the property is required. +// returns a *bool when successful +func (m *CustomPropertySetPayload) GetRequired()(*bool) { + return m.required +} +// GetValueType gets the value_type property value. The type of the value for the property +// returns a *CustomPropertySetPayload_value_type when successful +func (m *CustomPropertySetPayload) GetValueType()(*CustomPropertySetPayload_value_type) { + return m.value_type +} +// Serialize serializes information the current object +func (m *CustomPropertySetPayload) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedValues() != nil { + err := writer.WriteCollectionOfStringValues("allowed_values", m.GetAllowedValues()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("default_value", m.GetDefaultValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required", m.GetRequired()) + if err != nil { + return err + } + } + if m.GetValueType() != nil { + cast := (*m.GetValueType()).String() + err := writer.WriteStringValue("value_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CustomPropertySetPayload) 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 *CustomPropertySetPayload) SetAllowedValues(value []string)() { + m.allowed_values = value +} +// SetDefaultValue sets the default_value property value. Default value of the property +func (m *CustomPropertySetPayload) SetDefaultValue(value CustomPropertySetPayload_CustomPropertySetPayload_default_valueable)() { + m.default_value = value +} +// SetDescription sets the description property value. Short description of the property +func (m *CustomPropertySetPayload) SetDescription(value *string)() { + m.description = value +} +// SetRequired sets the required property value. Whether the property is required. +func (m *CustomPropertySetPayload) SetRequired(value *bool)() { + m.required = value +} +// SetValueType sets the value_type property value. The type of the value for the property +func (m *CustomPropertySetPayload) SetValueType(value *CustomPropertySetPayload_value_type)() { + m.value_type = value +} +type CustomPropertySetPayloadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedValues()([]string) + GetDefaultValue()(CustomPropertySetPayload_CustomPropertySetPayload_default_valueable) + GetDescription()(*string) + GetRequired()(*bool) + GetValueType()(*CustomPropertySetPayload_value_type) + SetAllowedValues(value []string)() + SetDefaultValue(value CustomPropertySetPayload_CustomPropertySetPayload_default_valueable)() + SetDescription(value *string)() + SetRequired(value *bool)() + SetValueType(value *CustomPropertySetPayload_value_type)() +} diff --git a/pkg/github/models/custom_property_set_payload_escaped_value_escaped_type.go b/pkg/github/models/custom_property_set_payload_escaped_value_escaped_type.go new file mode 100644 index 00000000..2d70a12e --- /dev/null +++ b/pkg/github/models/custom_property_set_payload_escaped_value_escaped_type.go @@ -0,0 +1,40 @@ +package models +// The type of the value for the property +type CustomPropertySetPayload_value_type int + +const ( + STRING_CUSTOMPROPERTYSETPAYLOAD_VALUE_TYPE CustomPropertySetPayload_value_type = iota + SINGLE_SELECT_CUSTOMPROPERTYSETPAYLOAD_VALUE_TYPE + MULTI_SELECT_CUSTOMPROPERTYSETPAYLOAD_VALUE_TYPE + TRUE_FALSE_CUSTOMPROPERTYSETPAYLOAD_VALUE_TYPE +) + +func (i CustomPropertySetPayload_value_type) String() string { + return []string{"string", "single_select", "multi_select", "true_false"}[i] +} +func ParseCustomPropertySetPayload_value_type(v string) (any, error) { + result := STRING_CUSTOMPROPERTYSETPAYLOAD_VALUE_TYPE + switch v { + case "string": + result = STRING_CUSTOMPROPERTYSETPAYLOAD_VALUE_TYPE + case "single_select": + result = SINGLE_SELECT_CUSTOMPROPERTYSETPAYLOAD_VALUE_TYPE + case "multi_select": + result = MULTI_SELECT_CUSTOMPROPERTYSETPAYLOAD_VALUE_TYPE + case "true_false": + result = TRUE_FALSE_CUSTOMPROPERTYSETPAYLOAD_VALUE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeCustomPropertySetPayload_value_type(values []CustomPropertySetPayload_value_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CustomPropertySetPayload_value_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/org_private_registry_configuration.go b/pkg/github/models/org_private_registry_configuration.go new file mode 100644 index 00000000..9bd87b6c --- /dev/null +++ b/pkg/github/models/org_private_registry_configuration.go @@ -0,0 +1,229 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgPrivateRegistryConfiguration private registry configuration for an organization +type OrgPrivateRegistryConfiguration struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the private registry configuration. + name *string + // The registry type. + registry_type *OrgPrivateRegistryConfiguration_registry_type + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The username to use when authenticating with the private registry. + username *string + // Which type of organization repositories have access to the private registry. + visibility *OrgPrivateRegistryConfiguration_visibility +} +// NewOrgPrivateRegistryConfiguration instantiates a new OrgPrivateRegistryConfiguration and sets the default values. +func NewOrgPrivateRegistryConfiguration()(*OrgPrivateRegistryConfiguration) { + m := &OrgPrivateRegistryConfiguration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgPrivateRegistryConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgPrivateRegistryConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgPrivateRegistryConfiguration(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *OrgPrivateRegistryConfiguration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *OrgPrivateRegistryConfiguration) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgPrivateRegistryConfiguration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["registry_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgPrivateRegistryConfiguration_registry_type) + if err != nil { + return err + } + if val != nil { + m.SetRegistryType(val.(*OrgPrivateRegistryConfiguration_registry_type)) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsername(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgPrivateRegistryConfiguration_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*OrgPrivateRegistryConfiguration_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the private registry configuration. +// returns a *string when successful +func (m *OrgPrivateRegistryConfiguration) GetName()(*string) { + return m.name +} +// GetRegistryType gets the registry_type property value. The registry type. +// returns a *OrgPrivateRegistryConfiguration_registry_type when successful +func (m *OrgPrivateRegistryConfiguration) GetRegistryType()(*OrgPrivateRegistryConfiguration_registry_type) { + return m.registry_type +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrgPrivateRegistryConfiguration) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUsername gets the username property value. The username to use when authenticating with the private registry. +// returns a *string when successful +func (m *OrgPrivateRegistryConfiguration) GetUsername()(*string) { + return m.username +} +// GetVisibility gets the visibility property value. Which type of organization repositories have access to the private registry. +// returns a *OrgPrivateRegistryConfiguration_visibility when successful +func (m *OrgPrivateRegistryConfiguration) GetVisibility()(*OrgPrivateRegistryConfiguration_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *OrgPrivateRegistryConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRegistryType() != nil { + cast := (*m.GetRegistryType()).String() + err := writer.WriteStringValue("registry_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("username", m.GetUsername()) + if err != nil { + return err + } + } + if m.GetVisibility() != nil { + cast := (*m.GetVisibility()).String() + err := writer.WriteStringValue("visibility", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *OrgPrivateRegistryConfiguration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrgPrivateRegistryConfiguration) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the private registry configuration. +func (m *OrgPrivateRegistryConfiguration) SetName(value *string)() { + m.name = value +} +// SetRegistryType sets the registry_type property value. The registry type. +func (m *OrgPrivateRegistryConfiguration) SetRegistryType(value *OrgPrivateRegistryConfiguration_registry_type)() { + m.registry_type = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrgPrivateRegistryConfiguration) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUsername sets the username property value. The username to use when authenticating with the private registry. +func (m *OrgPrivateRegistryConfiguration) SetUsername(value *string)() { + m.username = value +} +// SetVisibility sets the visibility property value. Which type of organization repositories have access to the private registry. +func (m *OrgPrivateRegistryConfiguration) SetVisibility(value *OrgPrivateRegistryConfiguration_visibility)() { + m.visibility = value +} +type OrgPrivateRegistryConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetRegistryType()(*OrgPrivateRegistryConfiguration_registry_type) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUsername()(*string) + GetVisibility()(*OrgPrivateRegistryConfiguration_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetRegistryType(value *OrgPrivateRegistryConfiguration_registry_type)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUsername(value *string)() + SetVisibility(value *OrgPrivateRegistryConfiguration_visibility)() +} diff --git a/pkg/github/models/org_private_registry_configuration_escaped_registry_escaped_type.go b/pkg/github/models/org_private_registry_configuration_escaped_registry_escaped_type.go new file mode 100644 index 00000000..8f83456b --- /dev/null +++ b/pkg/github/models/org_private_registry_configuration_escaped_registry_escaped_type.go @@ -0,0 +1,31 @@ +package models +// The registry type. +type OrgPrivateRegistryConfiguration_registry_type int + +const ( + MAVEN_REPOSITORY_ORGPRIVATEREGISTRYCONFIGURATION_REGISTRY_TYPE OrgPrivateRegistryConfiguration_registry_type = iota +) + +func (i OrgPrivateRegistryConfiguration_registry_type) String() string { + return []string{"maven_repository"}[i] +} +func ParseOrgPrivateRegistryConfiguration_registry_type(v string) (any, error) { + result := MAVEN_REPOSITORY_ORGPRIVATEREGISTRYCONFIGURATION_REGISTRY_TYPE + switch v { + case "maven_repository": + result = MAVEN_REPOSITORY_ORGPRIVATEREGISTRYCONFIGURATION_REGISTRY_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeOrgPrivateRegistryConfiguration_registry_type(values []OrgPrivateRegistryConfiguration_registry_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgPrivateRegistryConfiguration_registry_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/org_private_registry_configuration_escaped_visibility.go b/pkg/github/models/org_private_registry_configuration_escaped_visibility.go new file mode 100644 index 00000000..573e32f0 --- /dev/null +++ b/pkg/github/models/org_private_registry_configuration_escaped_visibility.go @@ -0,0 +1,37 @@ +package models +// Which type of organization repositories have access to the private registry. +type OrgPrivateRegistryConfiguration_visibility int + +const ( + ALL_ORGPRIVATEREGISTRYCONFIGURATION_VISIBILITY OrgPrivateRegistryConfiguration_visibility = iota + PRIVATE_ORGPRIVATEREGISTRYCONFIGURATION_VISIBILITY + SELECTED_ORGPRIVATEREGISTRYCONFIGURATION_VISIBILITY +) + +func (i OrgPrivateRegistryConfiguration_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseOrgPrivateRegistryConfiguration_visibility(v string) (any, error) { + result := ALL_ORGPRIVATEREGISTRYCONFIGURATION_VISIBILITY + switch v { + case "all": + result = ALL_ORGPRIVATEREGISTRYCONFIGURATION_VISIBILITY + case "private": + result = PRIVATE_ORGPRIVATEREGISTRYCONFIGURATION_VISIBILITY + case "selected": + result = SELECTED_ORGPRIVATEREGISTRYCONFIGURATION_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeOrgPrivateRegistryConfiguration_visibility(values []OrgPrivateRegistryConfiguration_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgPrivateRegistryConfiguration_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/org_private_registry_configuration_with_selected_repositories.go b/pkg/github/models/org_private_registry_configuration_with_selected_repositories.go new file mode 100644 index 00000000..1f327005 --- /dev/null +++ b/pkg/github/models/org_private_registry_configuration_with_selected_repositories.go @@ -0,0 +1,264 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgPrivateRegistryConfigurationWithSelectedRepositories private registry configuration for an organization +type OrgPrivateRegistryConfigurationWithSelectedRepositories struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the private registry configuration. + name *string + // The registry type. + registry_type *OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type + // An array of repository IDs that can access the organization private registry when `visibility` is set to `selected`. + selected_repository_ids []int32 + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The username to use when authenticating with the private registry. + username *string + // Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. + visibility *OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility +} +// NewOrgPrivateRegistryConfigurationWithSelectedRepositories instantiates a new OrgPrivateRegistryConfigurationWithSelectedRepositories and sets the default values. +func NewOrgPrivateRegistryConfigurationWithSelectedRepositories()(*OrgPrivateRegistryConfigurationWithSelectedRepositories) { + m := &OrgPrivateRegistryConfigurationWithSelectedRepositories{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgPrivateRegistryConfigurationWithSelectedRepositoriesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgPrivateRegistryConfigurationWithSelectedRepositoriesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgPrivateRegistryConfigurationWithSelectedRepositories(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["registry_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type) + if err != nil { + return err + } + if val != nil { + m.SetRegistryType(val.(*OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type)) + } + return nil + } + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsername(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgPrivateRegistryConfigurationWithSelectedRepositories_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the private registry configuration. +// returns a *string when successful +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) GetName()(*string) { + return m.name +} +// GetRegistryType gets the registry_type property value. The registry type. +// returns a *OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type when successful +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) GetRegistryType()(*OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type) { + return m.registry_type +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository IDs that can access the organization private registry when `visibility` is set to `selected`. +// returns a []int32 when successful +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUsername gets the username property value. The username to use when authenticating with the private registry. +// returns a *string when successful +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) GetUsername()(*string) { + return m.username +} +// GetVisibility gets the visibility property value. Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. +// returns a *OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility when successful +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) GetVisibility()(*OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRegistryType() != nil { + cast := (*m.GetRegistryType()).String() + err := writer.WriteStringValue("registry_type", &cast) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("username", m.GetUsername()) + if err != nil { + return err + } + } + if m.GetVisibility() != nil { + cast := (*m.GetVisibility()).String() + err := writer.WriteStringValue("visibility", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the private registry configuration. +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) SetName(value *string)() { + m.name = value +} +// SetRegistryType sets the registry_type property value. The registry type. +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) SetRegistryType(value *OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type)() { + m.registry_type = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository IDs that can access the organization private registry when `visibility` is set to `selected`. +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUsername sets the username property value. The username to use when authenticating with the private registry. +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) SetUsername(value *string)() { + m.username = value +} +// SetVisibility sets the visibility property value. Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. +func (m *OrgPrivateRegistryConfigurationWithSelectedRepositories) SetVisibility(value *OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility)() { + m.visibility = value +} +type OrgPrivateRegistryConfigurationWithSelectedRepositoriesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetRegistryType()(*OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type) + GetSelectedRepositoryIds()([]int32) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUsername()(*string) + GetVisibility()(*OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetRegistryType(value *OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type)() + SetSelectedRepositoryIds(value []int32)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUsername(value *string)() + SetVisibility(value *OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility)() +} diff --git a/pkg/github/models/org_private_registry_configuration_with_selected_repositories_escaped_registry_escaped_type.go b/pkg/github/models/org_private_registry_configuration_with_selected_repositories_escaped_registry_escaped_type.go new file mode 100644 index 00000000..86a20a1a --- /dev/null +++ b/pkg/github/models/org_private_registry_configuration_with_selected_repositories_escaped_registry_escaped_type.go @@ -0,0 +1,31 @@ +package models +// The registry type. +type OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type int + +const ( + MAVEN_REPOSITORY_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_REGISTRY_TYPE OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type = iota +) + +func (i OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type) String() string { + return []string{"maven_repository"}[i] +} +func ParseOrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type(v string) (any, error) { + result := MAVEN_REPOSITORY_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_REGISTRY_TYPE + switch v { + case "maven_repository": + result = MAVEN_REPOSITORY_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_REGISTRY_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeOrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type(values []OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgPrivateRegistryConfigurationWithSelectedRepositories_registry_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/org_private_registry_configuration_with_selected_repositories_escaped_visibility.go b/pkg/github/models/org_private_registry_configuration_with_selected_repositories_escaped_visibility.go new file mode 100644 index 00000000..79451730 --- /dev/null +++ b/pkg/github/models/org_private_registry_configuration_with_selected_repositories_escaped_visibility.go @@ -0,0 +1,37 @@ +package models +// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. +type OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility int + +const ( + ALL_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_VISIBILITY OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility = iota + PRIVATE_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_VISIBILITY + SELECTED_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_VISIBILITY +) + +func (i OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseOrgPrivateRegistryConfigurationWithSelectedRepositories_visibility(v string) (any, error) { + result := ALL_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_VISIBILITY + switch v { + case "all": + result = ALL_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_VISIBILITY + case "private": + result = PRIVATE_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_VISIBILITY + case "selected": + result = SELECTED_ORGPRIVATEREGISTRYCONFIGURATIONWITHSELECTEDREPOSITORIES_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeOrgPrivateRegistryConfigurationWithSelectedRepositories_visibility(values []OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgPrivateRegistryConfigurationWithSelectedRepositories_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/org_ruleset_conditions.go b/pkg/github/models/org_ruleset_conditions.go index 3c5051cb..355d3321 100644 --- a/pkg/github/models/org_ruleset_conditions.go +++ b/pkg/github/models/org_ruleset_conditions.go @@ -4,7 +4,7 @@ import ( i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" ) -// OrgRulesetConditions conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. +// OrgRulesetConditions conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. type OrgRulesetConditions struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any diff --git a/pkg/github/models/organization_secret_scanning_alert.go b/pkg/github/models/organization_secret_scanning_alert.go index ad0fddcc..dcd9a4cc 100644 --- a/pkg/github/models/organization_secret_scanning_alert.go +++ b/pkg/github/models/organization_secret_scanning_alert.go @@ -26,6 +26,8 @@ type OrganizationSecretScanningAlert struct { push_protection_bypass_request_html_url *string // A GitHub user. push_protection_bypass_request_reviewer NullableSimpleUserable + // An optional comment when reviewing a push protection bypass. + push_protection_bypass_request_reviewer_comment *string // Whether push protection was bypassed for the detected secret. push_protection_bypassed *bool // The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. @@ -173,6 +175,16 @@ func (m *OrganizationSecretScanningAlert) GetFieldDeserializers()(map[string]fun } return nil } + res["push_protection_bypass_request_reviewer_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassRequestReviewerComment(val) + } + return nil + } res["push_protection_bypassed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetBoolValue() if err != nil { @@ -380,6 +392,11 @@ func (m *OrganizationSecretScanningAlert) GetPushProtectionBypassRequestHtmlUrl( func (m *OrganizationSecretScanningAlert) GetPushProtectionBypassRequestReviewer()(NullableSimpleUserable) { return m.push_protection_bypass_request_reviewer } +// GetPushProtectionBypassRequestReviewerComment gets the push_protection_bypass_request_reviewer_comment property value. An optional comment when reviewing a push protection bypass. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetPushProtectionBypassRequestReviewerComment()(*string) { + return m.push_protection_bypass_request_reviewer_comment +} // GetRepository gets the repository property value. A GitHub repository. // returns a SimpleRepositoryable when successful func (m *OrganizationSecretScanningAlert) GetRepository()(SimpleRepositoryable) { @@ -496,6 +513,12 @@ func (m *OrganizationSecretScanningAlert) Serialize(writer i878a80d2330e89d26896 return err } } + { + err := writer.WriteStringValue("push_protection_bypass_request_reviewer_comment", m.GetPushProtectionBypassRequestReviewerComment()) + if err != nil { + return err + } + } { err := writer.WriteObjectValue("repository", m.GetRepository()) if err != nil { @@ -619,6 +642,10 @@ func (m *OrganizationSecretScanningAlert) SetPushProtectionBypassRequestHtmlUrl( func (m *OrganizationSecretScanningAlert) SetPushProtectionBypassRequestReviewer(value NullableSimpleUserable)() { m.push_protection_bypass_request_reviewer = value } +// SetPushProtectionBypassRequestReviewerComment sets the push_protection_bypass_request_reviewer_comment property value. An optional comment when reviewing a push protection bypass. +func (m *OrganizationSecretScanningAlert) SetPushProtectionBypassRequestReviewerComment(value *string)() { + m.push_protection_bypass_request_reviewer_comment = value +} // SetRepository sets the repository property value. A GitHub repository. func (m *OrganizationSecretScanningAlert) SetRepository(value SimpleRepositoryable)() { m.repository = value @@ -682,6 +709,7 @@ type OrganizationSecretScanningAlertable interface { GetPushProtectionBypassRequestComment()(*string) GetPushProtectionBypassRequestHtmlUrl()(*string) GetPushProtectionBypassRequestReviewer()(NullableSimpleUserable) + GetPushProtectionBypassRequestReviewerComment()(*string) GetRepository()(SimpleRepositoryable) GetResolution()(*SecretScanningAlertResolution) GetResolutionComment()(*string) @@ -706,6 +734,7 @@ type OrganizationSecretScanningAlertable interface { SetPushProtectionBypassRequestComment(value *string)() SetPushProtectionBypassRequestHtmlUrl(value *string)() SetPushProtectionBypassRequestReviewer(value NullableSimpleUserable)() + SetPushProtectionBypassRequestReviewerComment(value *string)() SetRepository(value SimpleRepositoryable)() SetResolution(value *SecretScanningAlertResolution)() SetResolutionComment(value *string)() diff --git a/pkg/github/models/rate_limit_overview_escaped_resources.go b/pkg/github/models/rate_limit_overview_escaped_resources.go index 71805c3a..69c1bd18 100644 --- a/pkg/github/models/rate_limit_overview_escaped_resources.go +++ b/pkg/github/models/rate_limit_overview_escaped_resources.go @@ -9,6 +9,8 @@ type RateLimitOverview_resources struct { actions_runner_registration RateLimitable // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any + // The code_scanning_autofix property + code_scanning_autofix RateLimitable // The code_scanning_upload property code_scanning_upload RateLimitable // The code_search property @@ -50,6 +52,11 @@ func (m *RateLimitOverview_resources) GetActionsRunnerRegistration()(RateLimitab func (m *RateLimitOverview_resources) GetAdditionalData()(map[string]any) { return m.additionalData } +// GetCodeScanningAutofix gets the code_scanning_autofix property value. The code_scanning_autofix property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetCodeScanningAutofix()(RateLimitable) { + return m.code_scanning_autofix +} // GetCodeScanningUpload gets the code_scanning_upload property value. The code_scanning_upload property // returns a RateLimitable when successful func (m *RateLimitOverview_resources) GetCodeScanningUpload()(RateLimitable) { @@ -84,6 +91,16 @@ func (m *RateLimitOverview_resources) GetFieldDeserializers()(map[string]func(i8 } return nil } + res["code_scanning_autofix"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningAutofix(val.(RateLimitable)) + } + return nil + } res["code_scanning_upload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) if err != nil { @@ -209,6 +226,12 @@ func (m *RateLimitOverview_resources) Serialize(writer i878a80d2330e89d26896388a return err } } + { + err := writer.WriteObjectValue("code_scanning_autofix", m.GetCodeScanningAutofix()) + if err != nil { + return err + } + } { err := writer.WriteObjectValue("code_scanning_upload", m.GetCodeScanningUpload()) if err != nil { @@ -279,6 +302,10 @@ func (m *RateLimitOverview_resources) SetActionsRunnerRegistration(value RateLim func (m *RateLimitOverview_resources) SetAdditionalData(value map[string]any)() { m.additionalData = value } +// SetCodeScanningAutofix sets the code_scanning_autofix property value. The code_scanning_autofix property +func (m *RateLimitOverview_resources) SetCodeScanningAutofix(value RateLimitable)() { + m.code_scanning_autofix = value +} // SetCodeScanningUpload sets the code_scanning_upload property value. The code_scanning_upload property func (m *RateLimitOverview_resources) SetCodeScanningUpload(value RateLimitable)() { m.code_scanning_upload = value @@ -319,6 +346,7 @@ type RateLimitOverview_resourcesable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetActionsRunnerRegistration()(RateLimitable) + GetCodeScanningAutofix()(RateLimitable) GetCodeScanningUpload()(RateLimitable) GetCodeSearch()(RateLimitable) GetCore()(RateLimitable) @@ -329,6 +357,7 @@ type RateLimitOverview_resourcesable interface { GetSearch()(RateLimitable) GetSourceImport()(RateLimitable) SetActionsRunnerRegistration(value RateLimitable)() + SetCodeScanningAutofix(value RateLimitable)() SetCodeScanningUpload(value RateLimitable)() SetCodeSearch(value RateLimitable)() SetCore(value RateLimitable)() diff --git a/pkg/github/models/repository_rule_pull_request_escaped_parameters.go b/pkg/github/models/repository_rule_pull_request_escaped_parameters.go index 97253253..19b2046f 100644 --- a/pkg/github/models/repository_rule_pull_request_escaped_parameters.go +++ b/pkg/github/models/repository_rule_pull_request_escaped_parameters.go @@ -7,6 +7,8 @@ import ( type RepositoryRulePullRequest_parameters struct { // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. additionalData map[string]any + // When merging pull requests, you can allow any combination of merge commits, squashing, or rebasing. At least one option must be enabled. + allowed_merge_methods []string // New, reviewable commits pushed will dismiss previous pull request review approvals. dismiss_stale_reviews_on_push *bool // Require an approving review in pull requests that modify files that have a designated code owner. @@ -35,6 +37,11 @@ func CreateRepositoryRulePullRequest_parametersFromDiscriminatorValue(parseNode func (m *RepositoryRulePullRequest_parameters) GetAdditionalData()(map[string]any) { return m.additionalData } +// GetAllowedMergeMethods gets the allowed_merge_methods property value. When merging pull requests, you can allow any combination of merge commits, squashing, or rebasing. At least one option must be enabled. +// returns a []string when successful +func (m *RepositoryRulePullRequest_parameters) GetAllowedMergeMethods()([]string) { + return m.allowed_merge_methods +} // GetDismissStaleReviewsOnPush gets the dismiss_stale_reviews_on_push property value. New, reviewable commits pushed will dismiss previous pull request review approvals. // returns a *bool when successful func (m *RepositoryRulePullRequest_parameters) GetDismissStaleReviewsOnPush()(*bool) { @@ -44,6 +51,22 @@ func (m *RepositoryRulePullRequest_parameters) GetDismissStaleReviewsOnPush()(*b // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *RepositoryRulePullRequest_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_merge_methods"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetAllowedMergeMethods(res) + } + return nil + } res["dismiss_stale_reviews_on_push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetBoolValue() if err != nil { @@ -118,6 +141,12 @@ func (m *RepositoryRulePullRequest_parameters) GetRequireLastPushApproval()(*boo } // Serialize serializes information the current object func (m *RepositoryRulePullRequest_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedMergeMethods() != nil { + err := writer.WriteCollectionOfStringValues("allowed_merge_methods", m.GetAllowedMergeMethods()) + if err != nil { + return err + } + } { err := writer.WriteBoolValue("dismiss_stale_reviews_on_push", m.GetDismissStaleReviewsOnPush()) if err != nil { @@ -160,6 +189,10 @@ func (m *RepositoryRulePullRequest_parameters) Serialize(writer i878a80d2330e89d func (m *RepositoryRulePullRequest_parameters) SetAdditionalData(value map[string]any)() { m.additionalData = value } +// SetAllowedMergeMethods sets the allowed_merge_methods property value. When merging pull requests, you can allow any combination of merge commits, squashing, or rebasing. At least one option must be enabled. +func (m *RepositoryRulePullRequest_parameters) SetAllowedMergeMethods(value []string)() { + m.allowed_merge_methods = value +} // SetDismissStaleReviewsOnPush sets the dismiss_stale_reviews_on_push property value. New, reviewable commits pushed will dismiss previous pull request review approvals. func (m *RepositoryRulePullRequest_parameters) SetDismissStaleReviewsOnPush(value *bool)() { m.dismiss_stale_reviews_on_push = value @@ -183,11 +216,13 @@ func (m *RepositoryRulePullRequest_parameters) SetRequireLastPushApproval(value type RepositoryRulePullRequest_parametersable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedMergeMethods()([]string) GetDismissStaleReviewsOnPush()(*bool) GetRequireCodeOwnerReview()(*bool) GetRequiredApprovingReviewCount()(*int32) GetRequiredReviewThreadResolution()(*bool) GetRequireLastPushApproval()(*bool) + SetAllowedMergeMethods(value []string)() SetDismissStaleReviewsOnPush(value *bool)() SetRequireCodeOwnerReview(value *bool)() SetRequiredApprovingReviewCount(value *int32)() diff --git a/pkg/github/models/repository_ruleset_escaped_source_escaped_type.go b/pkg/github/models/repository_ruleset_escaped_source_escaped_type.go index 4f486276..6b7aa74a 100644 --- a/pkg/github/models/repository_ruleset_escaped_source_escaped_type.go +++ b/pkg/github/models/repository_ruleset_escaped_source_escaped_type.go @@ -5,10 +5,11 @@ type RepositoryRuleset_source_type int const ( REPOSITORY_REPOSITORYRULESET_SOURCE_TYPE RepositoryRuleset_source_type = iota ORGANIZATION_REPOSITORYRULESET_SOURCE_TYPE + ENTERPRISE_REPOSITORYRULESET_SOURCE_TYPE ) func (i RepositoryRuleset_source_type) String() string { - return []string{"Repository", "Organization"}[i] + return []string{"Repository", "Organization", "Enterprise"}[i] } func ParseRepositoryRuleset_source_type(v string) (any, error) { result := REPOSITORY_REPOSITORYRULESET_SOURCE_TYPE @@ -17,6 +18,8 @@ func ParseRepositoryRuleset_source_type(v string) (any, error) { result = REPOSITORY_REPOSITORYRULESET_SOURCE_TYPE case "Organization": result = ORGANIZATION_REPOSITORYRULESET_SOURCE_TYPE + case "Enterprise": + result = ENTERPRISE_REPOSITORYRULESET_SOURCE_TYPE default: return nil, nil } diff --git a/pkg/github/models/repository_ruleset_escaped_target.go b/pkg/github/models/repository_ruleset_escaped_target.go index ea036dc8..1f8dd274 100644 --- a/pkg/github/models/repository_ruleset_escaped_target.go +++ b/pkg/github/models/repository_ruleset_escaped_target.go @@ -6,10 +6,11 @@ const ( BRANCH_REPOSITORYRULESET_TARGET RepositoryRuleset_target = iota TAG_REPOSITORYRULESET_TARGET PUSH_REPOSITORYRULESET_TARGET + REPOSITORY_REPOSITORYRULESET_TARGET ) func (i RepositoryRuleset_target) String() string { - return []string{"branch", "tag", "push"}[i] + return []string{"branch", "tag", "push", "repository"}[i] } func ParseRepositoryRuleset_target(v string) (any, error) { result := BRANCH_REPOSITORYRULESET_TARGET @@ -20,6 +21,8 @@ func ParseRepositoryRuleset_target(v string) (any, error) { result = TAG_REPOSITORYRULESET_TARGET case "push": result = PUSH_REPOSITORYRULESET_TARGET + case "repository": + result = REPOSITORY_REPOSITORYRULESET_TARGET default: return nil, nil } diff --git a/pkg/github/models/secret_scanning_alert.go b/pkg/github/models/secret_scanning_alert.go index 5664dcfc..b71ef98f 100644 --- a/pkg/github/models/secret_scanning_alert.go +++ b/pkg/github/models/secret_scanning_alert.go @@ -26,6 +26,8 @@ type SecretScanningAlert struct { push_protection_bypass_request_html_url *string // A GitHub user. push_protection_bypass_request_reviewer NullableSimpleUserable + // An optional comment when reviewing a push protection bypass. + push_protection_bypass_request_reviewer_comment *string // Whether push protection was bypassed for the detected secret. push_protection_bypassed *bool // The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. @@ -171,6 +173,16 @@ func (m *SecretScanningAlert) GetFieldDeserializers()(map[string]func(i878a80d23 } return nil } + res["push_protection_bypass_request_reviewer_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassRequestReviewerComment(val) + } + return nil + } res["push_protection_bypassed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetBoolValue() if err != nil { @@ -368,6 +380,11 @@ func (m *SecretScanningAlert) GetPushProtectionBypassRequestHtmlUrl()(*string) { func (m *SecretScanningAlert) GetPushProtectionBypassRequestReviewer()(NullableSimpleUserable) { return m.push_protection_bypass_request_reviewer } +// GetPushProtectionBypassRequestReviewerComment gets the push_protection_bypass_request_reviewer_comment property value. An optional comment when reviewing a push protection bypass. +// returns a *string when successful +func (m *SecretScanningAlert) GetPushProtectionBypassRequestReviewerComment()(*string) { + return m.push_protection_bypass_request_reviewer_comment +} // GetResolution gets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. // returns a *SecretScanningAlertResolution when successful func (m *SecretScanningAlert) GetResolution()(*SecretScanningAlertResolution) { @@ -479,6 +496,12 @@ func (m *SecretScanningAlert) Serialize(writer i878a80d2330e89d26896388a3f487eef return err } } + { + err := writer.WriteStringValue("push_protection_bypass_request_reviewer_comment", m.GetPushProtectionBypassRequestReviewerComment()) + if err != nil { + return err + } + } if m.GetResolution() != nil { cast := (*m.GetResolution()).String() err := writer.WriteStringValue("resolution", &cast) @@ -596,6 +619,10 @@ func (m *SecretScanningAlert) SetPushProtectionBypassRequestHtmlUrl(value *strin func (m *SecretScanningAlert) SetPushProtectionBypassRequestReviewer(value NullableSimpleUserable)() { m.push_protection_bypass_request_reviewer = value } +// SetPushProtectionBypassRequestReviewerComment sets the push_protection_bypass_request_reviewer_comment property value. An optional comment when reviewing a push protection bypass. +func (m *SecretScanningAlert) SetPushProtectionBypassRequestReviewerComment(value *string)() { + m.push_protection_bypass_request_reviewer_comment = value +} // SetResolution sets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. func (m *SecretScanningAlert) SetResolution(value *SecretScanningAlertResolution)() { m.resolution = value @@ -655,6 +682,7 @@ type SecretScanningAlertable interface { GetPushProtectionBypassRequestComment()(*string) GetPushProtectionBypassRequestHtmlUrl()(*string) GetPushProtectionBypassRequestReviewer()(NullableSimpleUserable) + GetPushProtectionBypassRequestReviewerComment()(*string) GetResolution()(*SecretScanningAlertResolution) GetResolutionComment()(*string) GetResolvedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) @@ -678,6 +706,7 @@ type SecretScanningAlertable interface { SetPushProtectionBypassRequestComment(value *string)() SetPushProtectionBypassRequestHtmlUrl(value *string)() SetPushProtectionBypassRequestReviewer(value NullableSimpleUserable)() + SetPushProtectionBypassRequestReviewerComment(value *string)() SetResolution(value *SecretScanningAlertResolution)() SetResolutionComment(value *string)() SetResolvedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() diff --git a/pkg/github/orgs/item/privateregistries/item/with_secret_escaped_name_patch_request_body_escaped_registry_escaped_type.go b/pkg/github/orgs/item/privateregistries/item/with_secret_escaped_name_patch_request_body_escaped_registry_escaped_type.go new file mode 100644 index 00000000..a3e87bff --- /dev/null +++ b/pkg/github/orgs/item/privateregistries/item/with_secret_escaped_name_patch_request_body_escaped_registry_escaped_type.go @@ -0,0 +1,31 @@ +package item +// The registry type. +type WithSecret_namePatchRequestBody_registry_type int + +const ( + MAVEN_REPOSITORY_WITHSECRET_NAMEPATCHREQUESTBODY_REGISTRY_TYPE WithSecret_namePatchRequestBody_registry_type = iota +) + +func (i WithSecret_namePatchRequestBody_registry_type) String() string { + return []string{"maven_repository"}[i] +} +func ParseWithSecret_namePatchRequestBody_registry_type(v string) (any, error) { + result := MAVEN_REPOSITORY_WITHSECRET_NAMEPATCHREQUESTBODY_REGISTRY_TYPE + switch v { + case "maven_repository": + result = MAVEN_REPOSITORY_WITHSECRET_NAMEPATCHREQUESTBODY_REGISTRY_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithSecret_namePatchRequestBody_registry_type(values []WithSecret_namePatchRequestBody_registry_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithSecret_namePatchRequestBody_registry_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/privateregistries/item/with_secret_escaped_name_patch_request_body_escaped_visibility.go b/pkg/github/orgs/item/privateregistries/item/with_secret_escaped_name_patch_request_body_escaped_visibility.go new file mode 100644 index 00000000..289b5ad4 --- /dev/null +++ b/pkg/github/orgs/item/privateregistries/item/with_secret_escaped_name_patch_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package item +// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. +type WithSecret_namePatchRequestBody_visibility int + +const ( + ALL_WITHSECRET_NAMEPATCHREQUESTBODY_VISIBILITY WithSecret_namePatchRequestBody_visibility = iota + PRIVATE_WITHSECRET_NAMEPATCHREQUESTBODY_VISIBILITY + SELECTED_WITHSECRET_NAMEPATCHREQUESTBODY_VISIBILITY +) + +func (i WithSecret_namePatchRequestBody_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseWithSecret_namePatchRequestBody_visibility(v string) (any, error) { + result := ALL_WITHSECRET_NAMEPATCHREQUESTBODY_VISIBILITY + switch v { + case "all": + result = ALL_WITHSECRET_NAMEPATCHREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_WITHSECRET_NAMEPATCHREQUESTBODY_VISIBILITY + case "selected": + result = SELECTED_WITHSECRET_NAMEPATCHREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeWithSecret_namePatchRequestBody_visibility(values []WithSecret_namePatchRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithSecret_namePatchRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/privateregistries/private_registries_post_request_body_escaped_registry_escaped_type.go b/pkg/github/orgs/item/privateregistries/private_registries_post_request_body_escaped_registry_escaped_type.go new file mode 100644 index 00000000..e339f06d --- /dev/null +++ b/pkg/github/orgs/item/privateregistries/private_registries_post_request_body_escaped_registry_escaped_type.go @@ -0,0 +1,31 @@ +package privateregistries +// The registry type. +type PrivateRegistriesPostRequestBody_registry_type int + +const ( + MAVEN_REPOSITORY_PRIVATEREGISTRIESPOSTREQUESTBODY_REGISTRY_TYPE PrivateRegistriesPostRequestBody_registry_type = iota +) + +func (i PrivateRegistriesPostRequestBody_registry_type) String() string { + return []string{"maven_repository"}[i] +} +func ParsePrivateRegistriesPostRequestBody_registry_type(v string) (any, error) { + result := MAVEN_REPOSITORY_PRIVATEREGISTRIESPOSTREQUESTBODY_REGISTRY_TYPE + switch v { + case "maven_repository": + result = MAVEN_REPOSITORY_PRIVATEREGISTRIESPOSTREQUESTBODY_REGISTRY_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializePrivateRegistriesPostRequestBody_registry_type(values []PrivateRegistriesPostRequestBody_registry_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PrivateRegistriesPostRequestBody_registry_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/privateregistries/private_registries_post_request_body_escaped_visibility.go b/pkg/github/orgs/item/privateregistries/private_registries_post_request_body_escaped_visibility.go new file mode 100644 index 00000000..9d052d2a --- /dev/null +++ b/pkg/github/orgs/item/privateregistries/private_registries_post_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package privateregistries +// Which type of organization repositories have access to the private registry. `selected` means only the repositories specified by `selected_repository_ids` can access the private registry. +type PrivateRegistriesPostRequestBody_visibility int + +const ( + ALL_PRIVATEREGISTRIESPOSTREQUESTBODY_VISIBILITY PrivateRegistriesPostRequestBody_visibility = iota + PRIVATE_PRIVATEREGISTRIESPOSTREQUESTBODY_VISIBILITY + SELECTED_PRIVATEREGISTRIESPOSTREQUESTBODY_VISIBILITY +) + +func (i PrivateRegistriesPostRequestBody_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParsePrivateRegistriesPostRequestBody_visibility(v string) (any, error) { + result := ALL_PRIVATEREGISTRIESPOSTREQUESTBODY_VISIBILITY + switch v { + case "all": + result = ALL_PRIVATEREGISTRIESPOSTREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_PRIVATEREGISTRIESPOSTREQUESTBODY_VISIBILITY + case "selected": + result = SELECTED_PRIVATEREGISTRIESPOSTREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializePrivateRegistriesPostRequestBody_visibility(values []PrivateRegistriesPostRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PrivateRegistriesPostRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/properties/schema/item/with_custom_escaped_property_escaped_name_put_request_body_escaped_value_escaped_type.go b/pkg/github/orgs/item/properties/schema/item/with_custom_escaped_property_escaped_name_put_request_body_escaped_value_escaped_type.go deleted file mode 100644 index c0d471ea..00000000 --- a/pkg/github/orgs/item/properties/schema/item/with_custom_escaped_property_escaped_name_put_request_body_escaped_value_escaped_type.go +++ /dev/null @@ -1,40 +0,0 @@ -package item -// The type of the value for the property -type WithCustom_property_namePutRequestBody_value_type int - -const ( - STRING_WITHCUSTOM_PROPERTY_NAMEPUTREQUESTBODY_VALUE_TYPE WithCustom_property_namePutRequestBody_value_type = iota - SINGLE_SELECT_WITHCUSTOM_PROPERTY_NAMEPUTREQUESTBODY_VALUE_TYPE - MULTI_SELECT_WITHCUSTOM_PROPERTY_NAMEPUTREQUESTBODY_VALUE_TYPE - TRUE_FALSE_WITHCUSTOM_PROPERTY_NAMEPUTREQUESTBODY_VALUE_TYPE -) - -func (i WithCustom_property_namePutRequestBody_value_type) String() string { - return []string{"string", "single_select", "multi_select", "true_false"}[i] -} -func ParseWithCustom_property_namePutRequestBody_value_type(v string) (any, error) { - result := STRING_WITHCUSTOM_PROPERTY_NAMEPUTREQUESTBODY_VALUE_TYPE - switch v { - case "string": - result = STRING_WITHCUSTOM_PROPERTY_NAMEPUTREQUESTBODY_VALUE_TYPE - case "single_select": - result = SINGLE_SELECT_WITHCUSTOM_PROPERTY_NAMEPUTREQUESTBODY_VALUE_TYPE - case "multi_select": - result = MULTI_SELECT_WITHCUSTOM_PROPERTY_NAMEPUTREQUESTBODY_VALUE_TYPE - case "true_false": - result = TRUE_FALSE_WITHCUSTOM_PROPERTY_NAMEPUTREQUESTBODY_VALUE_TYPE - default: - return nil, nil - } - return &result, nil -} -func SerializeWithCustom_property_namePutRequestBody_value_type(values []WithCustom_property_namePutRequestBody_value_type) []string { - result := make([]string, len(values)) - for i, v := range values { - result[i] = v.String() - } - return result -} -func (i WithCustom_property_namePutRequestBody_value_type) isMultiValue() bool { - return false -} diff --git a/pkg/github/orgs/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go b/pkg/github/orgs/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go index 5ec257fb..de4dba0a 100644 --- a/pkg/github/orgs/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go +++ b/pkg/github/orgs/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go @@ -6,10 +6,11 @@ const ( BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET WithRuleset_PutRequestBody_target = iota TAG_WITHRULESET_PUTREQUESTBODY_TARGET PUSH_WITHRULESET_PUTREQUESTBODY_TARGET + REPOSITORY_WITHRULESET_PUTREQUESTBODY_TARGET ) func (i WithRuleset_PutRequestBody_target) String() string { - return []string{"branch", "tag", "push"}[i] + return []string{"branch", "tag", "push", "repository"}[i] } func ParseWithRuleset_PutRequestBody_target(v string) (any, error) { result := BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET @@ -20,6 +21,8 @@ func ParseWithRuleset_PutRequestBody_target(v string) (any, error) { result = TAG_WITHRULESET_PUTREQUESTBODY_TARGET case "push": result = PUSH_WITHRULESET_PUTREQUESTBODY_TARGET + case "repository": + result = REPOSITORY_WITHRULESET_PUTREQUESTBODY_TARGET default: return nil, nil } diff --git a/pkg/github/orgs/item/rulesets/rulesets_post_request_body_escaped_target.go b/pkg/github/orgs/item/rulesets/rulesets_post_request_body_escaped_target.go index bba7d001..fc3e418a 100644 --- a/pkg/github/orgs/item/rulesets/rulesets_post_request_body_escaped_target.go +++ b/pkg/github/orgs/item/rulesets/rulesets_post_request_body_escaped_target.go @@ -6,10 +6,11 @@ const ( BRANCH_RULESETSPOSTREQUESTBODY_TARGET RulesetsPostRequestBody_target = iota TAG_RULESETSPOSTREQUESTBODY_TARGET PUSH_RULESETSPOSTREQUESTBODY_TARGET + REPOSITORY_RULESETSPOSTREQUESTBODY_TARGET ) func (i RulesetsPostRequestBody_target) String() string { - return []string{"branch", "tag", "push"}[i] + return []string{"branch", "tag", "push", "repository"}[i] } func ParseRulesetsPostRequestBody_target(v string) (any, error) { result := BRANCH_RULESETSPOSTREQUESTBODY_TARGET @@ -20,6 +21,8 @@ func ParseRulesetsPostRequestBody_target(v string) (any, error) { result = TAG_RULESETSPOSTREQUESTBODY_TARGET case "push": result = PUSH_RULESETSPOSTREQUESTBODY_TARGET + case "repository": + result = REPOSITORY_RULESETSPOSTREQUESTBODY_TARGET default: return nil, nil } diff --git a/pkg/github/orgs/item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go b/pkg/github/orgs/item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go index ab001233..de02b116 100644 --- a/pkg/github/orgs/item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go +++ b/pkg/github/orgs/item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go @@ -9,6 +9,8 @@ type ItemAttestationsItemWithSubject_digestGetResponse_attestations struct { additionalData map[string]any // The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. bundle ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable + // The bundle_url property + bundle_url *string // The repository_id property repository_id *int32 } @@ -34,6 +36,11 @@ func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetAddi func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetBundle()(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable) { return m.bundle } +// GetBundleUrl gets the bundle_url property value. The bundle_url property +// returns a *string when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetBundleUrl()(*string) { + return m.bundle_url +} // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { @@ -48,6 +55,16 @@ func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetFiel } return nil } + res["bundle_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBundleUrl(val) + } + return nil + } res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetInt32Value() if err != nil { @@ -73,6 +90,12 @@ func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) Seriali return err } } + { + err := writer.WriteStringValue("bundle_url", m.GetBundleUrl()) + if err != nil { + return err + } + } { err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) if err != nil { @@ -95,6 +118,10 @@ func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetAddi func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetBundle(value ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)() { m.bundle = value } +// SetBundleUrl sets the bundle_url property value. The bundle_url property +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetBundleUrl(value *string)() { + m.bundle_url = value +} // SetRepositoryId sets the repository_id property value. The repository_id property func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetRepositoryId(value *int32)() { m.repository_id = value @@ -103,7 +130,9 @@ type ItemAttestationsItemWithSubject_digestGetResponse_attestationsable interfac i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetBundle()(ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable) + GetBundleUrl()(*string) GetRepositoryId()(*int32) SetBundle(value ItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)() + SetBundleUrl(value *string)() SetRepositoryId(value *int32)() } diff --git a/pkg/github/orgs/item_private_registries_get_response.go b/pkg/github/orgs/item_private_registries_get_response.go new file mode 100644 index 00000000..c9395cc1 --- /dev/null +++ b/pkg/github/orgs/item_private_registries_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +type ItemPrivateRegistriesGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The configurations property + configurations []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationable + // The total_count property + total_count *int32 +} +// NewItemPrivateRegistriesGetResponse instantiates a new ItemPrivateRegistriesGetResponse and sets the default values. +func NewItemPrivateRegistriesGetResponse()(*ItemPrivateRegistriesGetResponse) { + m := &ItemPrivateRegistriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPrivateRegistriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPrivateRegistriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPrivateRegistriesGetResponse(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemPrivateRegistriesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfigurations gets the configurations property value. The configurations property +// returns a []OrgPrivateRegistryConfigurationable when successful +func (m *ItemPrivateRegistriesGetResponse) GetConfigurations()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationable) { + return m.configurations +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPrivateRegistriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["configurations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgPrivateRegistryConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationable) + } + } + m.SetConfigurations(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemPrivateRegistriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemPrivateRegistriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetConfigurations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetConfigurations())) + for i, v := range m.GetConfigurations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("configurations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemPrivateRegistriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfigurations sets the configurations property value. The configurations property +func (m *ItemPrivateRegistriesGetResponse) SetConfigurations(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationable)() { + m.configurations = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemPrivateRegistriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemPrivateRegistriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfigurations()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationable) + GetTotalCount()(*int32) + SetConfigurations(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_private_registries_item_with_secret_escaped_name_patch_request_body.go b/pkg/github/orgs/item_private_registries_item_with_secret_escaped_name_patch_request_body.go new file mode 100644 index 00000000..dffb2740 --- /dev/null +++ b/pkg/github/orgs/item_private_registries_item_with_secret_escaped_name_patch_request_body.go @@ -0,0 +1,173 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPrivateRegistriesItemWithSecret_namePatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. + encrypted_value *string + // The ID of the key you used to encrypt the secret. + key_id *string + // An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. This field should be omitted if `visibility` is set to `all` or `private`. + selected_repository_ids []int32 + // The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. + username *string +} +// NewItemPrivateRegistriesItemWithSecret_namePatchRequestBody instantiates a new ItemPrivateRegistriesItemWithSecret_namePatchRequestBody and sets the default values. +func NewItemPrivateRegistriesItemWithSecret_namePatchRequestBody()(*ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) { + m := &ItemPrivateRegistriesItemWithSecret_namePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPrivateRegistriesItemWithSecret_namePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPrivateRegistriesItemWithSecret_namePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPrivateRegistriesItemWithSecret_namePatchRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. +// returns a *string when successful +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + res["username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsername(val) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. The ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) GetKeyId()(*string) { + return m.key_id +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. This field should be omitted if `visibility` is set to `all` or `private`. +// returns a []int32 when successful +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// GetUsername gets the username property value. The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. +// returns a *string when successful +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) GetUsername()(*string) { + return m.username +} +// Serialize serializes information the current object +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("username", m.GetUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. The ID of the key you used to encrypt the secret. +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. This field should be omitted if `visibility` is set to `all` or `private`. +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +// SetUsername sets the username property value. The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. +func (m *ItemPrivateRegistriesItemWithSecret_namePatchRequestBody) SetUsername(value *string)() { + m.username = value +} +type ItemPrivateRegistriesItemWithSecret_namePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + GetSelectedRepositoryIds()([]int32) + GetUsername()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() + SetSelectedRepositoryIds(value []int32)() + SetUsername(value *string)() +} diff --git a/pkg/github/orgs/item_private_registries_post_request_body.go b/pkg/github/orgs/item_private_registries_post_request_body.go new file mode 100644 index 00000000..6661ad8a --- /dev/null +++ b/pkg/github/orgs/item_private_registries_post_request_body.go @@ -0,0 +1,173 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPrivateRegistriesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. + encrypted_value *string + // The ID of the key you used to encrypt the secret. + key_id *string + // An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. + selected_repository_ids []int32 + // The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. + username *string +} +// NewItemPrivateRegistriesPostRequestBody instantiates a new ItemPrivateRegistriesPostRequestBody and sets the default values. +func NewItemPrivateRegistriesPostRequestBody()(*ItemPrivateRegistriesPostRequestBody) { + m := &ItemPrivateRegistriesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPrivateRegistriesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPrivateRegistriesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPrivateRegistriesPostRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemPrivateRegistriesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. +// returns a *string when successful +func (m *ItemPrivateRegistriesPostRequestBody) GetEncryptedValue()(*string) { + return m.encrypted_value +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPrivateRegistriesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encrypted_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryptedValue(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + res["selected_repository_ids"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetSelectedRepositoryIds(res) + } + return nil + } + res["username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsername(val) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. The ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemPrivateRegistriesPostRequestBody) GetKeyId()(*string) { + return m.key_id +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. +// returns a []int32 when successful +func (m *ItemPrivateRegistriesPostRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// GetUsername gets the username property value. The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. +// returns a *string when successful +func (m *ItemPrivateRegistriesPostRequestBody) GetUsername()(*string) { + return m.username +} +// Serialize serializes information the current object +func (m *ItemPrivateRegistriesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encrypted_value", m.GetEncryptedValue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("username", m.GetUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemPrivateRegistriesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get private registries public key for an organization](https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. +func (m *ItemPrivateRegistriesPostRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. The ID of the key you used to encrypt the secret. +func (m *ItemPrivateRegistriesPostRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when `visibility` is set to `selected`. You can manage the list of selected repositories using the [Update a private registry for an organization](https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if `visibility` is set to `all` or `private`. +func (m *ItemPrivateRegistriesPostRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +// SetUsername sets the username property value. The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication. +func (m *ItemPrivateRegistriesPostRequestBody) SetUsername(value *string)() { + m.username = value +} +type ItemPrivateRegistriesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + GetSelectedRepositoryIds()([]int32) + GetUsername()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() + SetSelectedRepositoryIds(value []int32)() + SetUsername(value *string)() +} diff --git a/pkg/github/orgs/item_private_registries_public_key_get_response.go b/pkg/github/orgs/item_private_registries_public_key_get_response.go new file mode 100644 index 00000000..bc4dd33d --- /dev/null +++ b/pkg/github/orgs/item_private_registries_public_key_get_response.go @@ -0,0 +1,109 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPrivateRegistriesPublicKeyGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The Base64 encoded public key. + key *string + // The identifier for the key. + key_id *string +} +// NewItemPrivateRegistriesPublicKeyGetResponse instantiates a new ItemPrivateRegistriesPublicKeyGetResponse and sets the default values. +func NewItemPrivateRegistriesPublicKeyGetResponse()(*ItemPrivateRegistriesPublicKeyGetResponse) { + m := &ItemPrivateRegistriesPublicKeyGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPrivateRegistriesPublicKeyGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPrivateRegistriesPublicKeyGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPrivateRegistriesPublicKeyGetResponse(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemPrivateRegistriesPublicKeyGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPrivateRegistriesPublicKeyGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyId(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The Base64 encoded public key. +// returns a *string when successful +func (m *ItemPrivateRegistriesPublicKeyGetResponse) GetKey()(*string) { + return m.key +} +// GetKeyId gets the key_id property value. The identifier for the key. +// returns a *string when successful +func (m *ItemPrivateRegistriesPublicKeyGetResponse) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemPrivateRegistriesPublicKeyGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemPrivateRegistriesPublicKeyGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The Base64 encoded public key. +func (m *ItemPrivateRegistriesPublicKeyGetResponse) SetKey(value *string)() { + m.key = value +} +// SetKeyId sets the key_id property value. The identifier for the key. +func (m *ItemPrivateRegistriesPublicKeyGetResponse) SetKeyId(value *string)() { + m.key_id = value +} +type ItemPrivateRegistriesPublicKeyGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetKeyId()(*string) + SetKey(value *string)() + SetKeyId(value *string)() +} diff --git a/pkg/github/orgs/item_private_registries_public_key_request_builder.go b/pkg/github/orgs/item_private_registries_public_key_request_builder.go new file mode 100644 index 00000000..3f4f4656 --- /dev/null +++ b/pkg/github/orgs/item_private_registries_public_key_request_builder.go @@ -0,0 +1,61 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPrivateRegistriesPublicKeyRequestBuilder builds and executes requests for operations under \orgs\{org}\private-registries\public-key +type ItemPrivateRegistriesPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPrivateRegistriesPublicKeyRequestBuilderInternal instantiates a new ItemPrivateRegistriesPublicKeyRequestBuilder and sets the default values. +func NewItemPrivateRegistriesPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPrivateRegistriesPublicKeyRequestBuilder) { + m := &ItemPrivateRegistriesPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/private-registries/public-key", pathParameters), + } + return m +} +// NewItemPrivateRegistriesPublicKeyRequestBuilder instantiates a new ItemPrivateRegistriesPublicKeyRequestBuilder and sets the default values. +func NewItemPrivateRegistriesPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPrivateRegistriesPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPrivateRegistriesPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> This endpoint is in public preview and is subject to change.Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemPrivateRegistriesPublicKeyGetResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization +func (m *ItemPrivateRegistriesPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemPrivateRegistriesPublicKeyGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemPrivateRegistriesPublicKeyGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemPrivateRegistriesPublicKeyGetResponseable), nil +} +// ToGetRequestInformation > [!NOTE]> This endpoint is in public preview and is subject to change.Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPrivateRegistriesPublicKeyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPrivateRegistriesPublicKeyRequestBuilder when successful +func (m *ItemPrivateRegistriesPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemPrivateRegistriesPublicKeyRequestBuilder) { + return NewItemPrivateRegistriesPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_private_registries_request_builder.go b/pkg/github/orgs/item_private_registries_request_builder.go new file mode 100644 index 00000000..4effd473 --- /dev/null +++ b/pkg/github/orgs/item_private_registries_request_builder.go @@ -0,0 +1,124 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPrivateRegistriesRequestBuilder builds and executes requests for operations under \orgs\{org}\private-registries +type ItemPrivateRegistriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPrivateRegistriesRequestBuilderGetQueryParameters > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all private registry configurations available at the organization-level without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemPrivateRegistriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySecret_name gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.privateRegistries.item collection +// returns a *ItemPrivateRegistriesWithSecret_nameItemRequestBuilder when successful +func (m *ItemPrivateRegistriesRequestBuilder) BySecret_name(secret_name string)(*ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if secret_name != "" { + urlTplParams["secret_name"] = secret_name + } + return NewItemPrivateRegistriesWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPrivateRegistriesRequestBuilderInternal instantiates a new ItemPrivateRegistriesRequestBuilder and sets the default values. +func NewItemPrivateRegistriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPrivateRegistriesRequestBuilder) { + m := &ItemPrivateRegistriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/private-registries{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemPrivateRegistriesRequestBuilder instantiates a new ItemPrivateRegistriesRequestBuilder and sets the default values. +func NewItemPrivateRegistriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPrivateRegistriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPrivateRegistriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all private registry configurations available at the organization-level without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemPrivateRegistriesGetResponseable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/private-registries/organization-configurations#list-private-registries-for-an-organization +func (m *ItemPrivateRegistriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPrivateRegistriesRequestBuilderGetQueryParameters])(ItemPrivateRegistriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemPrivateRegistriesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemPrivateRegistriesGetResponseable), nil +} +// Post > [!NOTE]> This endpoint is in public preview and is subject to change.Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrgPrivateRegistryConfigurationWithSelectedRepositoriesable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/private-registries/organization-configurations#create-a-private-registry-for-an-organization +func (m *ItemPrivateRegistriesRequestBuilder) Post(ctx context.Context, body ItemPrivateRegistriesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationWithSelectedRepositoriesable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgPrivateRegistryConfigurationWithSelectedRepositoriesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationWithSelectedRepositoriesable), nil +} +// PublicKey the publicKey property +// returns a *ItemPrivateRegistriesPublicKeyRequestBuilder when successful +func (m *ItemPrivateRegistriesRequestBuilder) PublicKey()(*ItemPrivateRegistriesPublicKeyRequestBuilder) { + return NewItemPrivateRegistriesPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation > [!NOTE]> This endpoint is in public preview and is subject to change.Lists all private registry configurations available at the organization-level without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPrivateRegistriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPrivateRegistriesRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation > [!NOTE]> This endpoint is in public preview and is subject to change.Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPrivateRegistriesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemPrivateRegistriesPostRequestBodyable, 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 *ItemPrivateRegistriesRequestBuilder when successful +func (m *ItemPrivateRegistriesRequestBuilder) WithUrl(rawUrl string)(*ItemPrivateRegistriesRequestBuilder) { + return NewItemPrivateRegistriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_private_registries_with_secret_escaped_name_item_request_builder.go b/pkg/github/orgs/item_private_registries_with_secret_escaped_name_item_request_builder.go new file mode 100644 index 00000000..c5f6d496 --- /dev/null +++ b/pkg/github/orgs/item_private_registries_with_secret_escaped_name_item_request_builder.go @@ -0,0 +1,123 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemPrivateRegistriesWithSecret_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\private-registries\{secret_name} +type ItemPrivateRegistriesWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPrivateRegistriesWithSecret_nameItemRequestBuilderInternal instantiates a new ItemPrivateRegistriesWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemPrivateRegistriesWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) { + m := &ItemPrivateRegistriesWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/private-registries/{secret_name}", pathParameters), + } + return m +} +// NewItemPrivateRegistriesWithSecret_nameItemRequestBuilder instantiates a new ItemPrivateRegistriesWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemPrivateRegistriesWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPrivateRegistriesWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> This endpoint is in public preview and is subject to change.Delete a private registry configuration at the organization-level.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/private-registries/organization-configurations#delete-a-private-registry-for-an-organization +func (m *ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get > [!NOTE]> This endpoint is in public preview and is subject to change.Get the configuration of a single private registry defined for an organization, omitting its encrypted value.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrgPrivateRegistryConfigurationable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/private-registries/organization-configurations#get-a-private-registry-for-an-organization +func (m *ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateOrgPrivateRegistryConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgPrivateRegistryConfigurationable), nil +} +// Patch > [!NOTE]> This endpoint is in public preview and is subject to change.Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization +func (m *ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) Patch(ctx context.Context, body ItemPrivateRegistriesItemWithSecret_namePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "422": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!NOTE]> This endpoint is in public preview and is subject to change.Delete a private registry configuration at the organization-level.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json, application/scim+json") + return requestInfo, nil +} +// ToGetRequestInformation > [!NOTE]> This endpoint is in public preview and is subject to change.Get the configuration of a single private registry defined for an organization, omitting its encrypted value.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPatchRequestInformation > [!NOTE]> This endpoint is in public preview and is subject to change.Updates a private registry configuration with an encrypted value for an organization. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemPrivateRegistriesItemWithSecret_namePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPrivateRegistriesWithSecret_nameItemRequestBuilder when successful +func (m *ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemPrivateRegistriesWithSecret_nameItemRequestBuilder) { + return NewItemPrivateRegistriesWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_properties_schema_item_with_custom_escaped_property_escaped_name_put_request_body.go b/pkg/github/orgs/item_properties_schema_item_with_custom_escaped_property_escaped_name_put_request_body.go deleted file mode 100644 index da176ffa..00000000 --- a/pkg/github/orgs/item_properties_schema_item_with_custom_escaped_property_escaped_name_put_request_body.go +++ /dev/null @@ -1,273 +0,0 @@ -package orgs - -import ( - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" -) - -type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody struct { - // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - additionalData map[string]any - // An ordered list of the allowed values of the property.The property can have up to 200 allowed values. - allowed_values []string - // Default value of the property - default_value ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable - // Short description of the property - description *string - // Whether the property is required. - required *bool -} -// ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value composed type wrapper for classes string, []string -type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value struct { - // Composed type representation for type []string - string []string - // Composed type representation for type string - withCustom_property_namePutRequestBody_default_valueString *string -} -// NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value instantiates a new ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value and sets the default values. -func NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value()(*ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) { - m := &ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value{ - } - return m -} -// CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value -// returns a Parsable when successful -func CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { - result := NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value() - if parseNode != nil { - mappingValueNode, err := parseNode.GetChildNode("") - if err != nil { - return nil, err - } - if mappingValueNode != nil { - mappingValue, err := mappingValueNode.GetStringValue() - if err != nil { - return nil, err - } - if mappingValue != nil { - } - } - } - if val, err := parseNode.GetStringValue(); val != nil { - if err != nil { - return nil, err - } - result.SetWithCustomPropertyNamePutRequestBodyDefaultValueString(val) - } else if val, err := parseNode.GetCollectionOfPrimitiveValues("string"); val != nil { - if err != nil { - return nil, err - } - cast := make([]string, len(val)) - for i, v := range val { - if v != nil { - cast[i] = *(v.(*string)) - } - } - result.SetString(cast) - } - return result, nil -} -// GetFieldDeserializers the deserialization information for the current model -// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { - return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) -} -// GetIsComposedType determines if the current object is a wrapper around a composed type -// returns a bool when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) GetIsComposedType()(bool) { - return true -} -// GetString gets the string property value. Composed type representation for type []string -// returns a []string when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) GetString()([]string) { - return m.string -} -// GetWithCustomPropertyNamePutRequestBodyDefaultValueString gets the string property value. Composed type representation for type string -// returns a *string when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) GetWithCustomPropertyNamePutRequestBodyDefaultValueString()(*string) { - return m.withCustom_property_namePutRequestBody_default_valueString -} -// Serialize serializes information the current object -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { - if m.GetWithCustomPropertyNamePutRequestBodyDefaultValueString() != nil { - err := writer.WriteStringValue("", m.GetWithCustomPropertyNamePutRequestBodyDefaultValueString()) - if err != nil { - return err - } - } else if m.GetString() != nil { - err := writer.WriteCollectionOfStringValues("", m.GetString()) - if err != nil { - return err - } - } - return nil -} -// SetString sets the string property value. Composed type representation for type []string -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) SetString(value []string)() { - m.string = value -} -// SetWithCustomPropertyNamePutRequestBodyDefaultValueString sets the string property value. Composed type representation for type string -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) SetWithCustomPropertyNamePutRequestBodyDefaultValueString(value *string)() { - m.withCustom_property_namePutRequestBody_default_valueString = value -} -type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable interface { - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable - GetString()([]string) - GetWithCustomPropertyNamePutRequestBodyDefaultValueString()(*string) - SetString(value []string)() - SetWithCustomPropertyNamePutRequestBodyDefaultValueString(value *string)() -} -// NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody instantiates a new ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody and sets the default values. -func NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody()(*ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) { - m := &ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody{ - } - m.SetAdditionalData(make(map[string]any)) - return m -} -// CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value -// returns a Parsable when successful -func CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { - return NewItemPropertiesSchemaItemWithCustom_property_namePutRequestBody(), nil -} -// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -// returns a map[string]any when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetAdditionalData()(map[string]any) { - return m.additionalData -} -// GetAllowedValues gets the allowed_values property value. An ordered list of the allowed values of the property.The property can have up to 200 allowed values. -// returns a []string when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetAllowedValues()([]string) { - return m.allowed_values -} -// GetDefaultValue gets the default_value property value. Default value of the property -// returns a ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetDefaultValue()(ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable) { - return m.default_value -} -// GetDescription gets the description property value. Short description of the property -// returns a *string when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetDescription()(*string) { - return m.description -} -// GetFieldDeserializers the deserialization information for the current model -// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { - res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) - res["allowed_values"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetCollectionOfPrimitiveValues("string") - if err != nil { - return err - } - if val != nil { - res := make([]string, len(val)) - for i, v := range val { - if v != nil { - res[i] = *(v.(*string)) - } - } - m.SetAllowedValues(res) - } - return nil - } - res["default_value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetObjectValue(CreateItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueFromDiscriminatorValue) - if err != nil { - return err - } - if val != nil { - m.SetDefaultValue(val.(ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable)) - } - return nil - } - res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetStringValue() - if err != nil { - return err - } - if val != nil { - m.SetDescription(val) - } - return nil - } - res["required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetBoolValue() - if err != nil { - return err - } - if val != nil { - m.SetRequired(val) - } - return nil - } - return res -} -// GetRequired gets the required property value. Whether the property is required. -// returns a *bool when successful -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) GetRequired()(*bool) { - return m.required -} -// Serialize serializes information the current object -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { - if m.GetAllowedValues() != nil { - err := writer.WriteCollectionOfStringValues("allowed_values", m.GetAllowedValues()) - if err != nil { - return err - } - } - { - err := writer.WriteObjectValue("default_value", m.GetDefaultValue()) - if err != nil { - return err - } - } - { - err := writer.WriteStringValue("description", m.GetDescription()) - if err != nil { - return err - } - } - { - err := writer.WriteBoolValue("required", m.GetRequired()) - if err != nil { - return err - } - } - { - err := writer.WriteAdditionalData(m.GetAdditionalData()) - if err != nil { - return err - } - } - return nil -} -// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetAdditionalData(value map[string]any)() { - m.additionalData = value -} -// SetAllowedValues sets the allowed_values property value. An ordered list of the allowed values of the property.The property can have up to 200 allowed values. -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetAllowedValues(value []string)() { - m.allowed_values = value -} -// SetDefaultValue sets the default_value property value. Default value of the property -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetDefaultValue(value ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable)() { - m.default_value = value -} -// SetDescription sets the description property value. Short description of the property -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetDescription(value *string)() { - m.description = value -} -// SetRequired sets the required property value. Whether the property is required. -func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody) SetRequired(value *bool)() { - m.required = value -} -type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyable interface { - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable - GetAllowedValues()([]string) - GetDefaultValue()(ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable) - GetDescription()(*string) - GetRequired()(*bool) - SetAllowedValues(value []string)() - SetDefaultValue(value ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable)() - SetDescription(value *string)() - SetRequired(value *bool)() -} diff --git a/pkg/github/orgs/item_properties_schema_with_custom_escaped_property_escaped_name_item_request_builder.go b/pkg/github/orgs/item_properties_schema_with_custom_escaped_property_escaped_name_item_request_builder.go index 615a0112..255ba835 100644 --- a/pkg/github/orgs/item_properties_schema_with_custom_escaped_property_escaped_name_item_request_builder.go +++ b/pkg/github/orgs/item_properties_schema_with_custom_escaped_property_escaped_name_item_request_builder.go @@ -76,7 +76,7 @@ func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Get(ctx // [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.CustomPropertyable, error) { +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Put(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertySetPayloadable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertyable, error) { requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); if err != nil { return nil, err @@ -112,7 +112,7 @@ func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) ToGetRe } // ToPutRequestInformation creates a new or updates an existing custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. // returns a *RequestInformation when successful -func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemPropertiesSchemaItemWithCustom_property_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CustomPropertySetPayloadable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) requestInfo.Headers.TryAdd("Accept", "application/json") diff --git a/pkg/github/orgs/item_rulesets_item_with_ruleset_escaped_put_request_body.go b/pkg/github/orgs/item_rulesets_item_with_ruleset_escaped_put_request_body.go index 06bd1b0b..665114b6 100644 --- a/pkg/github/orgs/item_rulesets_item_with_ruleset_escaped_put_request_body.go +++ b/pkg/github/orgs/item_rulesets_item_with_ruleset_escaped_put_request_body.go @@ -10,7 +10,7 @@ type ItemRulesetsItemWithRuleset_PutRequestBody struct { additionalData map[string]any // The actors that can bypass the rules in this ruleset bypass_actors []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable - // Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. + // Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. conditions i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). enforcement *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement @@ -41,7 +41,7 @@ func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetAdditionalData()(map[str func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) { return m.bypass_actors } -// GetConditions gets the conditions property value. Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. +// GetConditions gets the conditions property value. Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. // returns a OrgRulesetConditionsable when successful func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable) { return m.conditions @@ -190,7 +190,7 @@ func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetAdditionalData(value map func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() { m.bypass_actors = value } -// SetConditions sets the conditions property value. Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. +// SetConditions sets the conditions property value. Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable)() { m.conditions = value } diff --git a/pkg/github/orgs/item_rulesets_post_request_body.go b/pkg/github/orgs/item_rulesets_post_request_body.go index 83fb5ca9..84acbfc3 100644 --- a/pkg/github/orgs/item_rulesets_post_request_body.go +++ b/pkg/github/orgs/item_rulesets_post_request_body.go @@ -10,7 +10,7 @@ type ItemRulesetsPostRequestBody struct { additionalData map[string]any // The actors that can bypass the rules in this ruleset bypass_actors []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable - // Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. + // Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. conditions i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise). enforcement *i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRuleEnforcement @@ -41,7 +41,7 @@ func (m *ItemRulesetsPostRequestBody) GetAdditionalData()(map[string]any) { func (m *ItemRulesetsPostRequestBody) GetBypassActors()([]i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable) { return m.bypass_actors } -// GetConditions gets the conditions property value. Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. +// GetConditions gets the conditions property value. Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. // returns a OrgRulesetConditionsable when successful func (m *ItemRulesetsPostRequestBody) GetConditions()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable) { return m.conditions @@ -190,7 +190,7 @@ func (m *ItemRulesetsPostRequestBody) SetAdditionalData(value map[string]any)() func (m *ItemRulesetsPostRequestBody) SetBypassActors(value []i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.RepositoryRulesetBypassActorable)() { m.bypass_actors = value } -// SetConditions sets the conditions property value. Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property. +// SetConditions sets the conditions property value. Conditions for an organization ruleset.The branch and tag rulesets conditions object should contain both `repository_name` and `ref_name` properties, or both `repository_id` and `ref_name` properties, or both `repository_property` and `ref_name` properties.The push rulesets conditions object does not require the `ref_name` property.For repository policy rulesets, the conditions object should only contain the `repository_name`, the `repository_id`, or the `repository_property`. func (m *ItemRulesetsPostRequestBody) SetConditions(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.OrgRulesetConditionsable)() { m.conditions = value } diff --git a/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go b/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go index 9c12fc74..faf4083b 100644 --- a/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go +++ b/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go @@ -29,7 +29,7 @@ type ItemSecretScanningAlertsRequestBuilderGetQueryParameters struct { Per_page *int32 `uriparametername:"per_page"` // A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. Resolution *string `uriparametername:"resolution"` - // A comma-separated list of secret types to return. By default all secret types are returned.See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)"for a complete list of secret types. + // A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. Secret_type *string `uriparametername:"secret_type"` // The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. Sort *i6bfc00bdb302bcd8be4fd093f881ba8f86d967800ec976c34a78d452c1f335d5.GetSortQueryParameterType `uriparametername:"sort"` diff --git a/pkg/github/orgs/item_security_managers_request_builder.go b/pkg/github/orgs/item_security_managers_request_builder.go index 28636e30..eba8db0d 100644 --- a/pkg/github/orgs/item_security_managers_request_builder.go +++ b/pkg/github/orgs/item_security_managers_request_builder.go @@ -23,7 +23,8 @@ func NewItemSecurityManagersRequestBuilder(rawUrl string, requestAdapter i2ae418 urlParams["request-raw-url"] = rawUrl return NewItemSecurityManagersRequestBuilderInternal(urlParams, requestAdapter) } -// Get lists teams that are security managers for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// Get > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. +// Deprecated: // returns a []TeamSimpleable when successful // [API method documentation] // @@ -50,7 +51,8 @@ func (m *ItemSecurityManagersRequestBuilder) Get(ctx context.Context, requestCon func (m *ItemSecurityManagersRequestBuilder) Teams()(*ItemSecurityManagersTeamsRequestBuilder) { return NewItemSecurityManagersTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// ToGetRequestInformation lists teams that are security managers for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an administrator or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// ToGetRequestInformation > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. +// Deprecated: // returns a *RequestInformation when successful func (m *ItemSecurityManagersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -59,6 +61,7 @@ func (m *ItemSecurityManagersRequestBuilder) ToGetRequestInformation(ctx context return requestInfo, nil } // WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: // returns a *ItemSecurityManagersRequestBuilder when successful func (m *ItemSecurityManagersRequestBuilder) WithUrl(rawUrl string)(*ItemSecurityManagersRequestBuilder) { return NewItemSecurityManagersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); diff --git a/pkg/github/orgs/item_security_managers_teams_request_builder.go b/pkg/github/orgs/item_security_managers_teams_request_builder.go index c1ed0016..3b6f2c7c 100644 --- a/pkg/github/orgs/item_security_managers_teams_request_builder.go +++ b/pkg/github/orgs/item_security_managers_teams_request_builder.go @@ -9,6 +9,7 @@ type ItemSecurityManagersTeamsRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } // ByTeam_slug gets an item from the github.com/octokit/go-sdk/pkg/github.orgs.item.securityManagers.teams.item collection +// Deprecated: // returns a *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder when successful func (m *ItemSecurityManagersTeamsRequestBuilder) ByTeam_slug(team_slug string)(*ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) { urlTplParams := make(map[string]string) diff --git a/pkg/github/orgs/item_security_managers_teams_with_team_escaped_slug_item_request_builder.go b/pkg/github/orgs/item_security_managers_teams_with_team_escaped_slug_item_request_builder.go index 8ffe05f6..d700c518 100644 --- a/pkg/github/orgs/item_security_managers_teams_with_team_escaped_slug_item_request_builder.go +++ b/pkg/github/orgs/item_security_managers_teams_with_team_escaped_slug_item_request_builder.go @@ -22,7 +22,8 @@ func NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder(rawUrl string, urlParams["request-raw-url"] = rawUrl return NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilderInternal(urlParams, requestAdapter) } -// Delete removes the security manager role from a team for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) team from an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// Delete > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. +// Deprecated: // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team @@ -37,7 +38,8 @@ func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) Delete(ctx co } return nil } -// Put adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// Put > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. +// Deprecated: // [API method documentation] // // [API method documentation]: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team @@ -52,14 +54,16 @@ func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) Put(ctx conte } return nil } -// ToDeleteRequestInformation removes the security manager role from a team for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) team from an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// ToDeleteRequestInformation > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. +// Deprecated: // returns a *RequestInformation when successful func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) return requestInfo, nil } -// ToPutRequestInformation adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization."The authenticated user must be an administrator for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// ToPutRequestInformation > [!WARNING]> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead. +// Deprecated: // returns a *RequestInformation when successful func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -67,6 +71,7 @@ func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) ToPutRequestI return requestInfo, nil } // WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// Deprecated: // returns a *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder when successful func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) WithUrl(rawUrl string)(*ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) { return NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder(rawUrl, 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 9cabc085..153059c9 100644 --- a/pkg/github/orgs/with_org_item_request_builder.go +++ b/pkg/github/orgs/with_org_item_request_builder.go @@ -236,6 +236,11 @@ func (m *WithOrgItemRequestBuilder) PersonalAccessTokenRequests()(*ItemPersonalA func (m *WithOrgItemRequestBuilder) PersonalAccessTokens()(*ItemPersonalAccessTokensRequestBuilder) { return NewItemPersonalAccessTokensRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// PrivateRegistries the privateRegistries property +// returns a *ItemPrivateRegistriesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) PrivateRegistries()(*ItemPrivateRegistriesRequestBuilder) { + return NewItemPrivateRegistriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} // Projects the projects property // returns a *ItemProjectsRequestBuilder when successful func (m *WithOrgItemRequestBuilder) Projects()(*ItemProjectsRequestBuilder) { diff --git a/pkg/github/repos/item_item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go b/pkg/github/repos/item_item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go index 71b36e3b..781d2583 100644 --- a/pkg/github/repos/item_item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go +++ b/pkg/github/repos/item_item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go @@ -9,6 +9,8 @@ type ItemItemAttestationsItemWithSubject_digestGetResponse_attestations struct { additionalData map[string]any // The attestation's Sigstore Bundle.Refer to the [Sigstore Bundle Specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto) for more information. bundle ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable + // The bundle_url property + bundle_url *string // The repository_id property repository_id *int32 } @@ -34,6 +36,11 @@ func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) Get func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) GetBundle()(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable) { return m.bundle } +// GetBundleUrl gets the bundle_url property value. The bundle_url property +// returns a *string when successful +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) GetBundleUrl()(*string) { + return m.bundle_url +} // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { @@ -48,6 +55,16 @@ func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) Get } return nil } + res["bundle_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBundleUrl(val) + } + return nil + } res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetInt32Value() if err != nil { @@ -73,6 +90,12 @@ func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) Ser return err } } + { + err := writer.WriteStringValue("bundle_url", m.GetBundleUrl()) + if err != nil { + return err + } + } { err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) if err != nil { @@ -95,6 +118,10 @@ func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) Set func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) SetBundle(value ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)() { m.bundle = value } +// SetBundleUrl sets the bundle_url property value. The bundle_url property +func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) SetBundleUrl(value *string)() { + m.bundle_url = value +} // SetRepositoryId sets the repository_id property value. The repository_id property func (m *ItemItemAttestationsItemWithSubject_digestGetResponse_attestations) SetRepositoryId(value *int32)() { m.repository_id = value @@ -103,7 +130,9 @@ type ItemItemAttestationsItemWithSubject_digestGetResponse_attestationsable inte i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetBundle()(ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable) + GetBundleUrl()(*string) GetRepositoryId()(*int32) SetBundle(value ItemItemAttestationsItemWithSubject_digestGetResponse_attestations_bundleable)() + SetBundleUrl(value *string)() SetRepositoryId(value *int32)() } diff --git a/pkg/github/repos/item_item_code_scanning_alerts_item_autofix_commits_request_builder.go b/pkg/github/repos/item_item_code_scanning_alerts_item_autofix_commits_request_builder.go new file mode 100644 index 00000000..719da89b --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_alerts_item_autofix_commits_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts\{alert_number}\autofix\commits +type ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilderInternal instantiates a new ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder) { + m := &ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}/autofix/commits", pathParameters), + } + return m +} +// NewItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder instantiates a new ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post commits an autofix for a code scanning alert.If an autofix is commited as a result of this request, then this endpoint will return a 201 Created response.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningAutofixCommitsResponseable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningAutofixCommitsResponse503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#commit-an-autofix-for-a-code-scanning-alert +func (m *ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder) Post(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAutofixCommitsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAutofixCommitsResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAutofixCommitsResponse503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAutofixCommitsResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAutofixCommitsResponseable), nil +} +// ToPostRequestInformation commits an autofix for a code scanning alert.If an autofix is commited as a result of this request, then this endpoint will return a 201 Created response.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder) ToPostRequestInformation(ctx context.Context, body i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAutofixCommitsable, 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 *ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder) { + return NewItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_code_scanning_alerts_item_autofix_request_builder.go b/pkg/github/repos/item_item_code_scanning_alerts_item_autofix_request_builder.go new file mode 100644 index 00000000..9f523f54 --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_alerts_item_autofix_request_builder.go @@ -0,0 +1,109 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6 "github.com/octokit/go-sdk/pkg/github/models" +) + +// ItemItemCodeScanningAlertsItemAutofixRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts\{alert_number}\autofix +type ItemItemCodeScanningAlertsItemAutofixRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Commits the commits property +// returns a *ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsItemAutofixRequestBuilder) Commits()(*ItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilder) { + return NewItemItemCodeScanningAlertsItemAutofixCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningAlertsItemAutofixRequestBuilderInternal instantiates a new ItemItemCodeScanningAlertsItemAutofixRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsItemAutofixRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsItemAutofixRequestBuilder) { + m := &ItemItemCodeScanningAlertsItemAutofixRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}/autofix", pathParameters), + } + return m +} +// NewItemItemCodeScanningAlertsItemAutofixRequestBuilder instantiates a new ItemItemCodeScanningAlertsItemAutofixRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsItemAutofixRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsItemAutofixRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAlertsItemAutofixRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the status and description of an autofix for a code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningAutofixable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningAutofix503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#get-the-status-of-an-autofix-for-a-code-scanning-alert +func (m *ItemItemCodeScanningAlertsItemAutofixRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAutofixable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAutofix503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAutofixFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAutofixable), nil +} +// Post creates an autofix for a code scanning alert.If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response.If an autofix already exists for a given alert, then this endpoint will return a 200 OK response.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a CodeScanningAutofixable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// returns a CodeScanningAutofix503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/rest/code-scanning/code-scanning#create-an-autofix-for-a-code-scanning-alert +func (m *ItemItemCodeScanningAlertsItemAutofixRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAutofixable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "403": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "404": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateBasicErrorFromDiscriminatorValue, + "503": i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAutofix503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CreateCodeScanningAutofixFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.CodeScanningAutofixable), nil +} +// ToGetRequestInformation gets the status and description of an autofix for a code scanning alert.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAlertsItemAutofixRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation creates an autofix for a code scanning alert.If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response.If an autofix already exists for a given alert, then this endpoint will return a 200 OK response.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningAlertsItemAutofixRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningAlertsItemAutofixRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsItemAutofixRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAlertsItemAutofixRequestBuilder) { + return NewItemItemCodeScanningAlertsItemAutofixRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_code_scanning_alerts_with_alert_escaped_number_item_request_builder.go b/pkg/github/repos/item_item_code_scanning_alerts_with_alert_escaped_number_item_request_builder.go index 628feae3..7f676451 100644 --- a/pkg/github/repos/item_item_code_scanning_alerts_with_alert_escaped_number_item_request_builder.go +++ b/pkg/github/repos/item_item_code_scanning_alerts_with_alert_escaped_number_item_request_builder.go @@ -10,6 +10,11 @@ import ( type ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } +// Autofix the autofix property +// returns a *ItemItemCodeScanningAlertsItemAutofixRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) Autofix()(*ItemItemCodeScanningAlertsItemAutofixRequestBuilder) { + return NewItemItemCodeScanningAlertsItemAutofixRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} // NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilderInternal instantiates a new ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder and sets the default values. func NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) { m := &ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder{ diff --git a/pkg/github/repos/item_item_secret_scanning_alerts_request_builder.go b/pkg/github/repos/item_item_secret_scanning_alerts_request_builder.go index c641571d..a3ec2bb7 100644 --- a/pkg/github/repos/item_item_secret_scanning_alerts_request_builder.go +++ b/pkg/github/repos/item_item_secret_scanning_alerts_request_builder.go @@ -30,7 +30,7 @@ type ItemItemSecretScanningAlertsRequestBuilderGetQueryParameters struct { Per_page *int32 `uriparametername:"per_page"` // A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are `false_positive`, `wont_fix`, `revoked`, `pattern_edited`, `pattern_deleted` or `used_in_tests`. Resolution *string `uriparametername:"resolution"` - // A comma-separated list of secret types to return. By default all secret types are returned.See "[Supported secret scanning patterns](https://docs.github.com/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)"for a complete list of secret types. + // A comma-separated list of secret types to return. All default secret patterns are returned. To return experimental patterns, pass the token name(s) in the parameter. See "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)" for a complete list of secret types. Secret_type *string `uriparametername:"secret_type"` // The property to sort the results by. `created` means when the alert was created. `updated` means when the alert was updated or resolved. Sort *ifed8ddc03e7fae238df937128818f42535837e18e6b784c23db9ad03bec21683.GetSortQueryParameterType `uriparametername:"sort"` diff --git a/pkg/github/users/item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go b/pkg/github/users/item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go index 36d436eb..5f5b005c 100644 --- a/pkg/github/users/item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go +++ b/pkg/github/users/item_attestations_item_with_subject_escaped_digest_get_response_escaped_attestations.go @@ -10,6 +10,8 @@ type ItemAttestationsItemWithSubject_digestGetResponse_attestations struct { additionalData map[string]any // Sigstore Bundle v0.1 bundle i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able + // The bundle_url property + bundle_url *string // The repository_id property repository_id *int32 } @@ -35,6 +37,11 @@ func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetAddi func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetBundle()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able) { return m.bundle } +// GetBundleUrl gets the bundle_url property value. The bundle_url property +// returns a *string when successful +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetBundleUrl()(*string) { + return m.bundle_url +} // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { @@ -49,6 +56,16 @@ func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) GetFiel } return nil } + res["bundle_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBundleUrl(val) + } + return nil + } res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetInt32Value() if err != nil { @@ -74,6 +91,12 @@ func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) Seriali return err } } + { + err := writer.WriteStringValue("bundle_url", m.GetBundleUrl()) + if err != nil { + return err + } + } { err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) if err != nil { @@ -96,6 +119,10 @@ func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetAddi func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetBundle(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able)() { m.bundle = value } +// SetBundleUrl sets the bundle_url property value. The bundle_url property +func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetBundleUrl(value *string)() { + m.bundle_url = value +} // SetRepositoryId sets the repository_id property value. The repository_id property func (m *ItemAttestationsItemWithSubject_digestGetResponse_attestations) SetRepositoryId(value *int32)() { m.repository_id = value @@ -104,7 +131,9 @@ type ItemAttestationsItemWithSubject_digestGetResponse_attestationsable interfac i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetBundle()(i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able) + GetBundleUrl()(*string) GetRepositoryId()(*int32) SetBundle(value i59ea7d99994c6a4bb9ef742ed717844297d055c7fd3742131406eea67a6404b6.SigstoreBundle0able)() + SetBundleUrl(value *string)() SetRepositoryId(value *int32)() }